decord/stable/source/stores/AuthenticationStore.tsx

830 lines
26 KiB
TypeScript
Raw Permalink Normal View History

// Module ID: 502
// Function ID: 503
// Name: AuthenticationStore
2026-10-06 22:12:49 +00:00
// Dependencies: [503, 1085, 1086, 1111, 3, 1112, 510, 1113, 1253, 13683, 585, 13684, 6364, 4738, 1266, 13685, 1243, 11802, 504, 10886, 13686, 7085, 1985, 2]
// Module 502 (AuthenticationStore)
import LoggerDefault from "Logger" /* 3 */;
2026-10-06 22:12:49 +00:00
import get_initializedDefault from "get initialized" /* 504 */;
import Storage6 from "Storage" /* 510 */;
2026-10-06 22:12:49 +00:00
import Dispatcher2 from "Dispatcher" /* 585 */;
import TokenManagerAll from "TokenManager" /* 1112 */;
import router_utils from "router_utils" /* 1113 */;
import SentryUtilsDefault from "SentryUtils" /* 1243 */;
import AnalyticsUtilsDefault from "AnalyticsUtils" /* 1253 */;
import FingerprintUtils from "FingerprintUtils" /* 1266 */;
import Server from "Server" /* 1985 */;
import APIErrorDefault from "APIError" /* 4738 */;
import getAuthenticationErrorsFromAPIError from "getAuthenticationErrorsFromAPIError" /* 6364 */;
import AuthenticationUtils from "AuthenticationUtils" /* 7085 */;
import ApexActionCreators from "ApexActionCreators" /* 10886 */;
import isStaffFromRawUserDefault from "isStaffFromRawUser" /* 11802 */;
import fetchExperiments2 from "fetchExperiments" /* 13683 */;
import awaitExperiments from "awaitExperiments" /* 13684 */;
import TrackingConsentUtilsDefault from "TrackingConsentUtils" /* 13685 */;
import react_native from "react-native" /* 13686 */;
import BrowserHandoffStore from "BrowserHandoffStore" /* 503 */;
2026-10-06 22:12:49 +00:00
import MobileCacheSnapshotStore from "MobileCacheSnapshotStore" /* 1085 */;
import Constants from "Constants" /* 1086 */;
import AgeGateConstants from "AgeGateConstants" /* 1111 */;
import size from "module_2" /* 2 */;
2026-10-06 22:12:49 +00:00
const Dispatcher = Dispatcher2;
let _null, c33, c4, c5, challenge;
let EXISTING_USER_AGE_GATE_MODAL_KEY;
let LoginStates;
let NEW_USER_AGE_GATE_MODAL_KEY;
let c10;
let closure_12;
let metroImportAll;
let unpackModuleId;
const f80358 = (body) => {
let assignments;
let guild_experiments;
body = body.body;
({ fingerprint, installation } = body);
let tmp = null != installation;
({ assignments, guild_experiments } = body);
if (tmp) {
tmp = installation.length > 0;
}
if (tmp) {
const obj2 = { type: "INSTALLATION_ID", installation };
const obj = Dispatcher;
obj.dispatch(obj2);
}
if (fingerprint) {
const obj4 = { type: "FINGERPRINT", fingerprint };
const obj3 = Dispatcher;
obj3.dispatch(obj4);
}
const obj5 = Dispatcher;
obj5.dispatch({ type: "EXPERIMENTS_FETCH_SUCCESS", fingerprint, experiments: assignments, guildExperiments: guild_experiments });
c33 = null;
const obj6 = awaitExperiments;
obj6.onExperimentsLoaded();
};
const f80359 = () => {
c33 = null;
const obj = Dispatcher;
obj.dispatch({ type: "EXPERIMENTS_FETCH_FAILURE" });
};
const f80360 = () => {
const obj = router_utils;
obj.transitionTo(constants.REGISTER);
};
function fetchFingerprint(arg0) {
2026-10-06 22:12:49 +00:00
let obj5;
let tmpResult4;
let flag = arg0;
if (arg0 === undefined) {
flag = true;
}
const Storage = Storage6.Storage;
_null = Storage.get(fingerprint);
const Storage2 = Storage6.Storage;
2026-10-06 22:12:49 +00:00
let value = Storage2.get(analytics_installation);
const tmp3 = analytics_installation;
if (null == value) {
const Storage3 = tmp(510).Storage;
2026-10-06 22:12:49 +00:00
const value2 = Storage3.get("analytics_installation");
let tmp4 = null;
if (null != value2) {
tmp4 = null;
if (value2.length > 0) {
const Storage4 = tmp(510).Storage;
2026-10-06 22:12:49 +00:00
const result = Storage4.set(tmp3, value2);
tmp4 = value2;
}
}
value = tmp4;
}
installation = value;
if (null != closure_33) {
return closure_33;
} else {
if (null != _null) {
let token = _null;
} else {
2026-10-06 22:12:49 +00:00
const obj = TokenManagerAll;
token = obj.getToken();
}
2026-10-06 22:12:49 +00:00
const tmpResult = router_utils;
if (tmpResult.isValidFingerprintRoute()) {
if (flag) {
2026-10-06 22:12:49 +00:00
let nextPromise;
if (!BrowserHandoffStore.isHandoffAvailable()) {
const obj2 = {};
2026-10-06 22:12:49 +00:00
const obj4 = AnalyticsUtilsDefault;
const superPropertiesBase64 = obj4.getSuperPropertiesBase64();
if (null != superPropertiesBase64) {
obj2["X-Super-Properties"] = superPropertiesBase64;
}
if (null != _null) {
obj2["X-Fingerprint"] = _null;
}
if (null != installation) {
obj2["X-Installation-ID"] = installation;
}
2026-10-06 22:12:49 +00:00
const obj3 = { withGuildExperiments: true, headers: obj2, context: obj5 };
obj5 = { location: tmpResult4.getFingerprintLocation() };
const fetchExperiments = fetchExperiments2.fetchExperiments;
fetchExperiments2;
tmpResult4 = router_utils;
const experiments = fetchExperiments(obj3);
nextPromise = experiments.then(f80358, f80359);
closure_33 = nextPromise;
}
return nextPromise;
}
}
nextPromise = Promise.resolve();
}
}
function handleLogout(isSwitchingAccount) {
2026-10-06 22:12:49 +00:00
let str;
const obj = TokenManagerAll;
const tmp2 = null != obj.getToken();
const Storage = Storage6.Storage;
2026-10-06 22:12:49 +00:00
const obj2 = { tokenManagerHasToken: tmp2, storageHasToken: null != Storage.get(closure_12) };
closure_13.verbose("handleLogout called.", obj2);
const obj3 = TokenManagerAll;
const tmp5 = null != obj3.getToken();
const Storage2 = Storage6.Storage;
2026-10-06 22:12:49 +00:00
const obj4 = { tokenManagerHasToken: tmp5, storageHasToken: null != Storage2.get(closure_12) };
closure_13.verbose("removeAuthToken called.", obj4);
const obj5 = TokenManagerAll;
obj5.removeAnalyticsToken();
let flag;
2026-10-06 22:12:49 +00:00
const obj6 = TokenManagerAll;
const removeTokenResult = obj6.removeToken();
if (isSwitchingAccount != null) {
flag = isSwitchingAccount.isSwitchingAccount;
}
if (flag == null) {
flag = false;
}
if (!flag) {
if (removeTokenResult) {
closure_22 = c21;
c21 = null;
const Storage3 = tmp3(510).Storage;
Storage3.remove(fingerprint);
}
fetchFingerprint();
}
2026-10-06 22:12:49 +00:00
const PersistedStore = get_initializedDefault.PersistedStore;
isSwitchingAccount = undefined;
2026-10-06 22:12:49 +00:00
const clearAll = PersistedStore.clearAll;
const obj7 = { omit: ["InstallationManagerStore", "AgeGateStore", "NativePermissionsStore", "MultiAccountStore", "DraftStore", "OverlayStoreV2", "StreamerModeStore", "LoginRequiredActionStore", "LayoutStore", "OverlaySettingsStore", "ApexExperimentStore", "AccessibilityStore", "DerivedQosDataStore"], type: str };
if (isSwitchingAccount != null) {
isSwitchingAccount = isSwitchingAccount.isSwitchingAccount;
}
2026-10-06 22:12:49 +00:00
str = "all";
if (isSwitchingAccount) {
str = "user-data-only";
}
2026-10-06 22:12:49 +00:00
clearAll(obj7);
const Store = tmp14(504).Store;
const result = Store.removeAllConditionalListeners();
MobileCacheSnapshotStore.clearAll();
2026-10-06 22:12:49 +00:00
const tmp14Result = SentryUtilsDefault;
tmp14Result.clearUser();
const Storage4 = tmp3(510).Storage;
Storage4.remove(user_id_cache);
id = null;
sessionId = null;
let isSwitchingAccount1;
if (isSwitchingAccount != null) {
isSwitchingAccount1 = isSwitchingAccount.isSwitchingAccount;
}
NONE = isSwitchingAccount1 ? tmp22.LOGGING_IN : tmp22.NONE;
c28 = "";
2026-10-06 22:12:49 +00:00
let c30 = null;
c29 = false;
c35 = false;
closure_36 = false;
items = [];
2026-10-06 22:12:49 +00:00
const tmp23 = c31;
if (tmp23) {
items.push({ type: "totp" });
}
2026-10-06 22:12:49 +00:00
const tmp25 = c32;
if (tmp25) {
items.push({ type: "backup" });
}
2026-10-06 22:12:49 +00:00
const tmp27 = c29;
if (tmp27) {
items.push({ type: "sms" });
}
}
2026-10-06 22:12:49 +00:00
({ AnalyticEvents: metroImportAll, LoginStates } = Constants);
({ Platforms: c10, Routes: unpackModuleId, TOKEN_KEY: closure_12 } = Constants);
({ EXISTING_USER_AGE_GATE_MODAL_KEY, NEW_USER_AGE_GATE_MODAL_KEY } = AgeGateConstants);
2026-10-06 22:12:49 +00:00
let tmp4 = new LoggerDefault("AuthenticationStore");
let closure_13 = tmp4;
let fingerprint = "fingerprint";
const analytics_installation = "analytics_installation";
const user_id_cache = "user_id_cache";
let id = null;
let sessionId = null;
let authSessionIdHash = null;
const staticAuthSessionId = null;
let c21 = null;
let closure_22 = null;
let installation = null;
let analyticsToken = null;
let NONE = LoginStates.NONE;
let c26 = false;
let authenticator_types = [];
let c28 = "";
let c29 = false;
let c30 = null;
let c31 = false;
let c32 = false;
let closure_33 = null;
let c34 = null;
let c35 = false;
let closure_36 = false;
let items = [];
2026-10-06 22:12:49 +00:00
let Store = get_initializedDefault.Store;
class AuthenticationStore extends Store {
2026-10-06 22:12:49 +00:00
initialize() {
const Storage = Storage6.Storage;
id = Storage.get(user_id_cache);
const Storage2 = Storage6.Storage;
let value = Storage2.get(analytics_installation);
const tmp3 = analytics_installation;
if (null == value) {
const Storage3 = tmp(510).Storage;
const value2 = Storage3.get("analytics_installation");
let tmp4 = null;
if (null != value2) {
tmp4 = null;
if (value2.length > 0) {
const Storage4 = tmp(510).Storage;
const result = Storage4.set(tmp3, value2);
tmp4 = value2;
}
}
value = tmp4;
}
installation = value;
let obj = TokenManagerAll;
if (null == obj.getToken()) {
const tmp7 = null == installation || 0 === installation.length;
const promise = fetchFingerprint();
if (tmp7) {
function fireApex() {
const obj = ApexActionCreators;
const installationExperiments = obj.fetchInstallationExperiments(null);
}
promise.then(fireApex, fireApex);
}
}
2026-10-06 22:12:49 +00:00
this.addChangeListener(() => {
const obj = react_native;
return obj.setClientState(id);
});
}
2026-10-06 22:12:49 +00:00
getLoginStatus() {
return NONE;
}
getId() {
return id;
}
getSessionId() {
return sessionId;
}
getAuthSessionIdHash() {
return authSessionIdHash;
}
getStaticAuthSessionId() {
return staticAuthSessionId;
}
getToken() {
const obj = AuthenticationUtils;
return obj.getToken();
}
isAuthenticated() {
const obj = AuthenticationUtils;
return obj.isAuthenticated();
}
getFingerprint() {
return c21;
}
getInstallationForTracking() {
let tmp = null;
const obj = TrackingConsentUtilsDefault;
if (obj.canUseInstallationId()) {
tmp = installation;
}
2026-10-06 22:12:49 +00:00
return tmp;
}
2026-10-06 22:12:49 +00:00
getAnalyticsToken() {
if (analyticsToken == null) {
const obj = TokenManagerAll;
analyticsToken = obj.getAnalyticsToken();
}
return analyticsToken;
}
2026-10-06 22:12:49 +00:00
getMFATicket() {
return c28;
}
2026-10-06 22:12:49 +00:00
getMFAMethods() {
return items;
}
2026-10-06 22:12:49 +00:00
getLoginInstanceId() {
return c5;
}
hasTOTPEnabled() {
return authenticator_types.includes(Server.AuthenticatorType.TOTP);
}
getCredentials() {
if (null == c4) {
const _Error = Error;
const self = this;
const self2 = this;
const error = new Error("no credentials");
throw error;
} else {
return c4;
}
}
allowLogoutRedirect() {
return !c26;
}
getSuspendedUserToken() {
return c34;
}
getIsPasswordlessActive() {
return c35;
}
attemptedPasswordLogin() {
return closure_36;
}
}
const prototype = AuthenticationStore.prototype;
AuthenticationStore.displayName = "AuthenticationStore";
2026-10-06 22:12:49 +00:00
let obj = {
CONNECTION_OPEN: function handleConnectionOpen(arg0) {
2026-10-06 22:12:49 +00:00
let apexExperiments;
let auth;
let email;
let user;
let username;
({ user, analyticsToken, auth, apexExperiments } = arg0);
({ sessionId, authSessionIdHash, staticAuthSessionId } = arg0);
2026-10-06 22:12:49 +00:00
const obj = TokenManagerAll;
const tmp3 = null != obj.getToken();
const Storage = Storage6.Storage;
2026-10-06 22:12:49 +00:00
const obj2 = { tokenManagerHasToken: tmp3, storageHasToken: null != Storage.get(closure_12) };
closure_13.verbose("handleConnectionOpen called", obj2);
({ id, username, email } = user);
2026-10-06 22:12:49 +00:00
const setUser = SentryUtilsDefault.setUser;
SentryUtilsDefault;
setUser(id, username, email, isStaffFromRawUserDefault(user));
const tmpResult = TokenManagerAll;
tmpResult.setAnalyticsToken(analyticsToken);
id = user.id;
if (undefined !== auth) {
authenticator_types = auth.authenticator_types;
}
const Storage2 = tmp4(510).Storage;
const result = Storage2.set(user_id_cache, user.id);
let installation1;
if (apexExperiments != null) {
installation1 = apexExperiments.installation;
}
if (null != installation1) {
installation = apexExperiments.installation;
if (null == installation) {
2026-10-06 22:12:49 +00:00
const tmp6Result = TrackingConsentUtilsDefault;
if (tmp6Result.canUseInstallationId()) {
const Storage3 = tmp4(510).Storage;
const result1 = Storage3.set(analytics_installation, installation);
}
}
}
const Storage4 = tmp4(510).Storage;
2026-10-06 22:12:49 +00:00
if (Storage4.get(metroImportAll.APP_FIRST_LOGIN, true)) {
const obj3 = { platform: constants2.IOS };
const tmp6Result2 = AnalyticsUtilsDefault;
tmp6Result2.track(metroImportAll.APP_FIRST_LOGIN, obj3);
const Storage5 = tmp4(510).Storage;
2026-10-06 22:12:49 +00:00
const result2 = Storage5.set(tmp16.APP_FIRST_LOGIN, false);
}
},
OVERLAY_INITIALIZE: function handleOverlayInitialize(arg0) {
2026-10-06 22:12:49 +00:00
let email;
let token;
let user;
let username;
({ user, analyticsToken } = arg0);
({ sessionId, token } = arg0);
({ id, username, email } = user);
2026-10-06 22:12:49 +00:00
const setUser = SentryUtilsDefault.setUser;
SentryUtilsDefault;
setUser(id, username, email, isStaffFromRawUserDefault(user));
const id2 = user.id;
2026-10-06 22:12:49 +00:00
const obj = TokenManagerAll;
const tmp6 = null != obj.getToken();
const Storage = Storage6.Storage;
2026-10-06 22:12:49 +00:00
const obj2 = { tokenManagerHasToken: tmp6, storageHasToken: null != Storage.get(closure_12) };
closure_13.verbose("setAuthToken called.", obj2);
const tmp9 = null != id2 && id2 === id;
if (!tmp9) {
const tmp5Result = TokenManagerAll;
tmp5Result.removeAnalyticsToken();
}
const tmp5Result3 = TokenManagerAll;
tmp5Result3.setToken(token, id2);
if (null != analyticsToken) {
2026-10-06 22:12:49 +00:00
const tmp5Result4 = TokenManagerAll;
tmp5Result4.setAnalyticsToken(analyticsToken);
}
closure_22 = c21;
c21 = null;
2026-10-06 22:12:49 +00:00
const Storage2 = tmp7(510).Storage;
Storage2.remove(fingerprint);
id = user.id;
2026-10-06 22:12:49 +00:00
const Storage3 = tmp7(510).Storage;
const result = Storage3.set(user_id_cache, user.id);
},
CONNECTION_CLOSED: function handleConnectionClosed(code) {
2026-10-06 22:12:49 +00:00
let Storage2;
code = code.code;
const combined = "handleConnectionClosed called with code " + code + ".";
2026-10-06 22:12:49 +00:00
let obj = TokenManagerAll;
const tmp3 = null != obj.getToken();
const Storage = Storage6.Storage;
2026-10-06 22:12:49 +00:00
const obj2 = { tokenManagerHasToken: tmp3, storageHasToken: null != Storage.get(closure_12) };
closure_13.verbose(combined, obj2);
if (4004 === code) {
2026-10-06 22:12:49 +00:00
const tmp6 = c26;
if (tmp6) {
c26 = true;
handleLogout();
2026-10-06 22:12:49 +00:00
const obj4 = Dispatcher;
obj4.wait(f80360);
} else {
2026-10-06 22:12:49 +00:00
const obj3 = { user_id: Storage2.get(user_id_cache) };
const track = AnalyticsUtilsDefault.track;
const APP_USER_DEAUTHENTICATED = metroImportAll.APP_USER_DEAUTHENTICATED;
AnalyticsUtilsDefault;
Storage2 = Storage6.Storage;
track(APP_USER_DEAUTHENTICATED, obj3);
handleLogout();
const _setImmediate = setImmediate;
2026-10-06 22:12:49 +00:00
setImmediate(() => {
const obj = router_utils;
return obj.transitionTo(constants.DEFAULT_LOGGED_OUT);
});
}
}
},
AUTH_SESSION_CHANGE: function handleAuthSessionChange(authSessionIdHash) {
authSessionIdHash = authSessionIdHash.authSessionIdHash;
},
LOGIN: function handleLogin(arg0) {
NONE = LoginStates.LOGGING_IN;
2026-10-06 22:12:49 +00:00
const tmp2 = closure_36 || true === tmp;
closure_36 = tmp2;
},
LOGIN_SUCCESS: function handleLoginSuccess(token) {
NONE = LoginStates.NONE;
2026-10-06 22:12:49 +00:00
token = token.token;
const obj = TokenManagerAll;
const tmp = null != obj.getToken();
const Storage = Storage6.Storage;
2026-10-06 22:12:49 +00:00
const obj2 = { tokenManagerHasToken: tmp, storageHasToken: null != Storage.get(closure_12) };
closure_13.verbose("setAuthToken called.", obj2);
const obj3 = TokenManagerAll;
obj3.removeAnalyticsToken();
const obj4 = TokenManagerAll;
obj4.setToken(token, undefined);
closure_22 = c21;
c21 = null;
const Storage2 = Storage6.Storage;
Storage2.remove(fingerprint);
c28 = "";
c29 = false;
2026-10-06 22:12:49 +00:00
let c30 = null;
c5 = null;
items = [];
2026-10-06 22:12:49 +00:00
const tmp6 = c31;
if (tmp6) {
items.push({ type: "totp" });
}
2026-10-06 22:12:49 +00:00
const tmp8 = c32;
if (tmp8) {
items.push({ type: "backup" });
}
2026-10-06 22:12:49 +00:00
const tmp10 = c29;
if (tmp10) {
items.push({ type: "sms" });
}
c35 = false;
c34 = null;
},
LOGIN_FAILURE: function handleLoginFailure(error) {
c28 = "";
c29 = false;
2026-10-06 22:12:49 +00:00
let c30 = null;
c5 = null;
items = [];
2026-10-06 22:12:49 +00:00
error = error.error;
if (c31) {
items.push({ type: "totp" });
}
2026-10-06 22:12:49 +00:00
const tmp2 = c32;
if (tmp2) {
items.push({ type: "backup" });
}
2026-10-06 22:12:49 +00:00
const tmp4 = c29;
if (tmp4) {
items.push({ type: "sms" });
}
2026-10-06 22:12:49 +00:00
const obj = getAuthenticationErrorsFromAPIError;
if (null != obj.getAuthenticationErrorsFromV6OrEarlierAPIError(error).date_of_birth) {
NONE = LoginStates.LOGIN_AGE_GATE;
} else {
NONE = LoginStates.NONE;
}
},
LOGIN_MFA_STEP: function handleLoginMFAStep(arg0) {
2026-10-06 22:12:49 +00:00
let ticket;
let webauthn;
({ ticket, webauthn } = arg0);
if (null != ticket) {
c28 = ticket;
c29 = tmp;
if (webauthn == null) {
webauthn = null;
}
challenge = webauthn;
c32 = tmp2;
c31 = tmp3;
c5 = tmp4;
items = [];
if (null != webauthn) {
const obj = { type: "webauthn", challenge };
items.push(obj);
}
2026-10-06 22:12:49 +00:00
const tmp7 = c31;
if (tmp7) {
items.push({ type: "totp" });
}
2026-10-06 22:12:49 +00:00
const tmp9 = c32;
if (tmp9) {
items.push({ type: "backup" });
}
2026-10-06 22:12:49 +00:00
const tmp11 = c29;
if (tmp11) {
items.push({ type: "sms" });
}
}
NONE = LoginStates.MFA_STEP;
},
LOGIN_MFA: function handleLoginMFA() {
NONE = LoginStates.LOGGING_IN_MFA;
},
LOGIN_ACCOUNT_SCHEDULED_FOR_DELETION: function handleLoginAccountPendingDeletion(credentials) {
NONE = LoginStates.ACCOUNT_SCHEDULED_FOR_DELETION;
credentials = credentials.credentials;
},
LOGIN_ACCOUNT_DISABLED: function handleLoginAccountDisabled(credentials) {
NONE = LoginStates.ACCOUNT_DISABLED;
credentials = credentials.credentials;
},
LOGIN_PASSWORD_RECOVERY_PHONE_VERIFICATION: function handleLoginPasswordRecoveryPhoneVerification(credentials) {
NONE = LoginStates.PASSWORD_RECOVERY_PHONE_VERIFICATION;
credentials = credentials.credentials;
},
LOGIN_PHONE_IP_AUTHORIZATION_REQUIRED: function handleLoginPhoneIPAuthorizationRequired(credentials) {
NONE = LoginStates.PHONE_IP_AUTHORIZATION;
credentials = credentials.credentials;
},
LOGIN_RESET: function handleLoginReset(isMultiAccount) {
NONE = LoginStates.NONE;
c28 = "";
c29 = false;
2026-10-06 22:12:49 +00:00
let c30 = null;
c5 = null;
c4 = null;
if (!isMultiAccount.isMultiAccount) {
items = [];
2026-10-06 22:12:49 +00:00
const tmp = c31;
if (tmp) {
items.push({ type: "totp" });
}
2026-10-06 22:12:49 +00:00
const tmp3 = c32;
if (tmp3) {
items.push({ type: "backup" });
}
2026-10-06 22:12:49 +00:00
const tmp5 = c29;
if (tmp5) {
items.push({ type: "sms" });
}
2026-10-06 22:12:49 +00:00
const obj = TokenManagerAll;
const tmp9 = null != obj.getToken();
const Storage = Storage6.Storage;
2026-10-06 22:12:49 +00:00
const obj2 = { tokenManagerHasToken: tmp9, storageHasToken: null != Storage.get(closure_12) };
closure_13.verbose("removeAuthToken called.", obj2);
2026-10-06 22:12:49 +00:00
const obj3 = TokenManagerAll;
obj3.removeAnalyticsToken();
const obj4 = TokenManagerAll;
obj4.removeToken();
fetchFingerprint(false);
}
},
LOGIN_STATUS_RESET: function handleLoginStatusReset() {
NONE = LoginStates.NONE;
},
LOGIN_SUSPENDED_USER: function handleSuspendedUserLogin(suspendedUserToken) {
c35 = false;
suspendedUserToken = suspendedUserToken.suspendedUserToken;
2026-10-06 22:12:49 +00:00
setImmediate(() => {
const obj = router_utils;
return obj.transitionTo(constants.ACCOUNT_STANDING);
});
},
LOGOUT: handleLogout,
FINGERPRINT: function handleFingerprint(fingerprint) {
2026-10-06 22:12:49 +00:00
let obj2;
let obj3;
let obj6;
fingerprint = fingerprint.fingerprint;
if (null == c21) {
if (null != fingerprint) {
let extractIdResult = null;
2026-10-06 22:12:49 +00:00
const track2 = AnalyticsUtilsDefault.track;
const USER_FINGERPRINT_CHANGED = metroImportAll.USER_FINGERPRINT_CHANGED;
AnalyticsUtilsDefault;
if (null != closure_22) {
2026-10-06 22:12:49 +00:00
const obj4 = FingerprintUtils;
extractIdResult = obj4.extractId(closure_22);
}
2026-10-06 22:12:49 +00:00
const obj5 = { old_fingerprint: extractIdResult, new_fingerprint: obj6.extractId(fingerprint) };
obj6 = FingerprintUtils;
track2(USER_FINGERPRINT_CHANGED, obj5);
c21 = fingerprint;
closure_22 = fingerprint;
const Storage = Storage6.Storage;
const result = Storage.set(fingerprint, c21);
} else {
fetchFingerprint();
}
} else {
2026-10-06 22:12:49 +00:00
const tmp2 = null != fingerprint && c21 !== fingerprint;
if (tmp2) {
2026-10-06 22:12:49 +00:00
const obj = { fingerprint: obj2.extractId(c21), dropped_fingerprint: obj3.extractId(fingerprint) };
const track = AnalyticsUtilsDefault.track;
const EXTERNAL_FINGERPRINT_DROPPED = metroImportAll.EXTERNAL_FINGERPRINT_DROPPED;
AnalyticsUtilsDefault;
obj2 = FingerprintUtils;
obj3 = FingerprintUtils;
track(EXTERNAL_FINGERPRINT_DROPPED, obj);
}
}
},
INSTALLATION_ID: function handleInstallationId(installation) {
installation = installation.installation;
if (null != installation) {
if (installation.length > 0) {
return false;
}
}
2026-10-06 22:12:49 +00:00
const obj = TrackingConsentUtilsDefault;
if (obj.canUseInstallationId()) {
const Storage = Storage6.Storage;
const result = Storage.set(analytics_installation, installation);
}
},
REGISTER_SUCCESS: function handleRegisterSuccess(token) {
2026-10-06 22:12:49 +00:00
token = token.token;
const obj = TokenManagerAll;
const tmp = null != obj.getToken();
const Storage = Storage6.Storage;
2026-10-06 22:12:49 +00:00
const obj2 = { tokenManagerHasToken: tmp, storageHasToken: null != Storage.get(closure_12) };
closure_13.verbose("setAuthToken called.", obj2);
const obj3 = TokenManagerAll;
obj3.removeAnalyticsToken();
const obj4 = TokenManagerAll;
obj4.setToken(token, undefined);
closure_22 = c21;
c21 = null;
const Storage2 = Storage6.Storage;
Storage2.remove(fingerprint);
},
FORGOT_PASSWORD_REQUEST: function handleForgotPasswordRequest() {
NONE = LoginStates.FORGOT_PASSWORD;
},
FORGOT_PASSWORD_SENT: function handleForgotPasswordSent() {
NONE = LoginStates.NONE;
},
UPDATE_TOKEN: function handleUpdateToken(userId) {
userId = userId.userId;
2026-10-06 22:12:49 +00:00
const token = userId.token;
const obj = TokenManagerAll;
const tmp3 = null != obj.getToken();
const Storage = Storage6.Storage;
2026-10-06 22:12:49 +00:00
const obj2 = { tokenManagerHasToken: tmp3, storageHasToken: null != Storage.get(closure_12) };
closure_13.verbose("handleUpdateToken called", obj2);
const obj3 = TokenManagerAll;
const tmp6 = null != obj3.getToken();
const Storage2 = Storage6.Storage;
2026-10-06 22:12:49 +00:00
const obj4 = { tokenManagerHasToken: tmp6, storageHasToken: null != Storage2.get(closure_12) };
closure_13.verbose("setAuthToken called.", obj4);
let tmp8 = null != userId;
if (tmp8) {
tmp8 = userId === id;
}
if (!tmp8) {
2026-10-06 22:12:49 +00:00
const tmpResult = TokenManagerAll;
tmpResult.removeAnalyticsToken();
}
2026-10-06 22:12:49 +00:00
const tmpResult2 = TokenManagerAll;
tmpResult2.setToken(token, userId);
closure_22 = c21;
c21 = null;
const Storage3 = Storage6.Storage;
Storage3.remove(fingerprint);
},
EXPERIMENTS_FETCH(withGuildExperiments) {
2026-10-06 22:12:49 +00:00
let obj4;
let obj5;
let obj = {};
2026-10-06 22:12:49 +00:00
let tmp = dependencyMap;
withGuildExperiments = withGuildExperiments.withGuildExperiments;
let obj2 = AnalyticsUtilsDefault;
const superPropertiesBase64 = obj2.getSuperPropertiesBase64();
if (null != superPropertiesBase64) {
obj["X-Super-Properties"] = superPropertiesBase64;
}
if (null != _null) {
obj["X-Fingerprint"] = _null;
}
if (null != installation) {
obj["X-Installation-ID"] = installation;
}
2026-10-06 22:12:49 +00:00
let obj3 = { withGuildExperiments, headers: obj, context: obj4 };
const tmp5 = fetchExperiments2;
obj4 = { location: obj5.getFingerprintLocation() };
const fetchExperiments = tmp5.fetchExperiments;
obj5 = router_utils;
const experiments = fetchExperiments(obj3);
closure_33 = experiments.then(f80358, f80359);
},
CURRENT_USER_UPDATE: function handleUserUpdate(user) {
user = user.user;
id = user.id;
if (undefined !== user.authenticator_types) {
authenticator_types = user.authenticator_types;
}
const Storage = Storage6.Storage;
const result = Storage.set(user_id_cache, user.id);
},
AGE_GATE_LOGOUT_UNDERAGE_NEW_USER: function handleAgeGateUnderage() {
c26 = true;
handleLogout();
2026-10-06 22:12:49 +00:00
const obj = Dispatcher;
obj.wait(f80360);
},
CLOSE_SUSPENDED_USER: function handleSuspendedUserClosed() {
c34 = null;
NONE = LoginStates.NONE;
handleLogout();
2026-10-06 22:12:49 +00:00
setImmediate(() => {
const obj = router_utils;
return obj.transitionTo(constants.DEFAULT_LOGGED_OUT);
});
},
PASSWORDLESS_FAILURE: function handlePasswordlessFailure(error) {
error = error.error;
c28 = "";
c29 = false;
2026-10-06 22:12:49 +00:00
let c30 = null;
c35 = false;
c5 = null;
if (error instanceof APIErrorDefault) {
2026-10-06 22:12:49 +00:00
const obj = getAuthenticationErrorsFromAPIError;
if (null != obj.getAuthenticationErrorsFromAPIError(error).date_of_birth) {
NONE = LoginStates.LOGIN_AGE_GATE;
} else {
NONE = LoginStates.NONE;
}
} else {
NONE = LoginStates.NONE;
}
},
PASSWORDLESS_START: function handlePasswordlessStart() {
c35 = true;
}
2026-10-06 22:12:49 +00:00
};
const authenticationStore = new AuthenticationStore(Dispatcher, obj, Dispatcher2.DispatchBand.Early);
let result = size.fileFinishedImporting("stores/AuthenticationStore.tsx");
export default authenticationStore;