gdfgd
This commit is contained in:
+21
-4
@@ -645,11 +645,16 @@
|
||||
|
||||
if (data.success) {
|
||||
this.isSessionReady = true;
|
||||
if (data.csrf_token) {
|
||||
if (window.f0ckSession) window.f0ckSession.csrf_token = data.csrf_token;
|
||||
const metaCsrf = document.querySelector('meta[name="csrf-token"]');
|
||||
if (metaCsrf) metaCsrf.content = data.csrf_token;
|
||||
if (window.f0ckSession) {
|
||||
window.f0ckSession.user = 'anonymous';
|
||||
window.f0ckSession.is_anon = true;
|
||||
window.f0ckSession.logged_in = true;
|
||||
window.f0ckSession.id = data.user_id;
|
||||
window.f0ckSession.user_id = data.user_id;
|
||||
if (data.csrf_token) window.f0ckSession.csrf_token = data.csrf_token;
|
||||
}
|
||||
const metaCsrf = document.querySelector('meta[name="csrf-token"]');
|
||||
if (metaCsrf && data.csrf_token) metaCsrf.content = data.csrf_token;
|
||||
window.f0ckAnonIdentity = {
|
||||
userId: data.user_id,
|
||||
fingerprint: data.fingerprint,
|
||||
@@ -657,6 +662,9 @@
|
||||
hwFingerprint: data.hw_fingerprint || hwFingerprint
|
||||
};
|
||||
window.dispatchEvent(new CustomEvent('f0ck:anon_session_ready', { detail: window.f0ckAnonIdentity }));
|
||||
if (typeof window.syncRatingButtonUI === 'function') {
|
||||
window.syncRatingButtonUI();
|
||||
}
|
||||
}
|
||||
} catch (err) {
|
||||
console.warn('[ANON_SSH] Session handshake failed:', err);
|
||||
@@ -870,6 +878,15 @@
|
||||
const guestFavsLink = document.getElementById('nav-guest-favs-link');
|
||||
if (guestFavsNav) guestFavsNav.style.display = isAnon ? '' : 'none';
|
||||
if (guestFavsLink) guestFavsLink.style.display = isAnon ? '' : 'none';
|
||||
|
||||
if (isAnon && window.f0ckSession) {
|
||||
window.f0ckSession.user = window.f0ckSession.user || 'anonymous';
|
||||
window.f0ckSession.is_anon = true;
|
||||
window.f0ckSession.logged_in = true;
|
||||
}
|
||||
if (typeof window.syncRatingButtonUI === 'function') {
|
||||
window.syncRatingButtonUI();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user