583 lines
30 KiB
TypeScript
583 lines
30 KiB
TypeScript
/* Metro module 1226; source: stores/AuthenticationStore.tsx; dependencies: [6, 7, 15, 17, 18, 1227, 1228, 661, 1229, 3, 692, 587, 1230, 683, 507, 694, 12830, 8977, 4132, 490, 12831, 1216, 11878, 566, 10566, 12832, 1355, 1909, 2] */
|
|
function _fun13691(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#13691, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1353:6, offset: 0x00df2b45, size: 999 bytes, params: 8, frame: 23
|
|
var object2;
|
|
const env0_0 = require;
|
|
const closure = INSTALLATION_ID;
|
|
const closure2 = AGE_GATE_LOGOUT_UNDERAGE_NEW_USER;
|
|
const closure3 = LOGOUT_13708;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
const env0_4 = importDefault(6) /* metro dependency 6 */;
|
|
const env0_5 = importDefault(7) /* metro dependency 7 */;
|
|
const env0_6 = importDefault(15) /* metro dependency 15 */;
|
|
const env0_7 = importDefault(17) /* metro dependency 17 */;
|
|
const env0_8 = importDefault(18) /* metro dependency 18 */;
|
|
const browserHandoffStoreNative = importDefault(1227) /* metro dependency 1227: BrowserHandoffStoreNative */;
|
|
const mobileCacheSnapshotStore = importDefault(1228) /* metro dependency 1228: MobileCacheSnapshotStore */;
|
|
let value = require(661) /* metro dependency 661: Constants */;
|
|
const env0_11 = value.AnalyticEvents;
|
|
const env0_12 = value.Endpoints;
|
|
const LoginStates = value.LoginStates;
|
|
const env0_14 = value.Platforms;
|
|
const env0_15 = value.Routes;
|
|
const env0_16 = value.TOKEN_KEY;
|
|
value = require(1229) /* metro dependency 1229: AgeGateConstants */;
|
|
value.EXISTING_USER_AGE_GATE_MODAL_KEY;
|
|
value.NEW_USER_AGE_GATE_MODAL_KEY;
|
|
value = importDefault(3) /* metro dependency 3: Logger */;
|
|
value = new value('AuthenticationStore');
|
|
let env0_31 = LoginStates.NONE;
|
|
const env0_33 = [];
|
|
const env0_43 = [];
|
|
const Store = (importDefault(566) /* metro dependency 566: flux */).Store;
|
|
_fun13709(Store).displayName = 'AuthenticationStore';
|
|
const dispatcher = importDefault(694) /* metro dependency 694: Dispatcher */;
|
|
object2 = {CONNECTION_OPEN: CONNECTION_OPEN_13733, OVERLAY_INITIALIZE: OVERLAY_INITIALIZE,
|
|
CONNECTION_CLOSED: CONNECTION_CLOSED, AUTH_SESSION_CHANGE: AUTH_SESSION_CHANGE, LOGIN: LOGIN,
|
|
LOGIN_SUCCESS: function({token}) {
|
|
env0_31 = LoginStates.NONE;
|
|
setAuthToken(token);
|
|
clearFingerprint();
|
|
env0_34 = '';
|
|
env0_35 = false;
|
|
env0_36 = null;
|
|
env0_18 = null;
|
|
updateMFAMethods();
|
|
env0_41 = false;
|
|
}, LOGIN_FAILURE: function({error}) {
|
|
env0_34 = '';
|
|
env0_35 = false;
|
|
env0_36 = null;
|
|
env0_18 = null;
|
|
updateMFAMethods();
|
|
env0_31 = require(dependencyMap[17]).getAuthenticationErrorsFromV6OrEarlierAPIError(error).date_of_birth != null ? LoginStates.LOGIN_AGE_GATE : LoginStates.NONE;
|
|
}, LOGIN_MFA_STEP: LOGIN_MFA_STEP, LOGIN_MFA: function() {
|
|
env0_31 = LoginStates.LOGGING_IN_MFA;
|
|
}, LOGIN_ACCOUNT_SCHEDULED_FOR_DELETION: function(a0) {
|
|
env0_31 = LoginStates.ACCOUNT_SCHEDULED_FOR_DELETION;
|
|
env0_17 = a0.credentials;
|
|
}, LOGIN_ACCOUNT_DISABLED: function(a0) {
|
|
env0_31 = LoginStates.ACCOUNT_DISABLED;
|
|
env0_17 = a0.credentials;
|
|
}, LOGIN_PASSWORD_RECOVERY_PHONE_VERIFICATION: function(a0) {
|
|
env0_31 = LoginStates.PASSWORD_RECOVERY_PHONE_VERIFICATION;
|
|
env0_17 = a0.credentials;
|
|
}, LOGIN_PHONE_IP_AUTHORIZATION_REQUIRED: function(a0) {
|
|
env0_31 = LoginStates.PHONE_IP_AUTHORIZATION;
|
|
env0_17 = a0.credentials;
|
|
}, LOGIN_RESET: function({isMultiAccount}) {
|
|
env0_31 = LoginStates.NONE;
|
|
env0_34 = '';
|
|
env0_35 = false;
|
|
env0_36 = null;
|
|
env0_18 = null;
|
|
env0_17 = null;
|
|
if (!isMultiAccount) {
|
|
updateMFAMethods();
|
|
removeAuthToken();
|
|
fetchFingerprint(false);
|
|
}
|
|
}, LOGIN_STATUS_RESET: function() {
|
|
env0_31 = LoginStates.NONE;
|
|
}, LOGIN_SUSPENDED_USER: function({suspendedUserToken}) {
|
|
env0_41 = false;
|
|
env0_40 = suspendedUserToken;
|
|
global.setImmediate(_fun13750);
|
|
}, LOGOUT: closure3, FINGERPRINT: FINGERPRINT, INSTALLATION_ID: closure, REGISTER_SUCCESS: function({token}) {
|
|
setAuthToken(token);
|
|
clearFingerprint();
|
|
}, FORGOT_PASSWORD_REQUEST: function() {
|
|
env0_31 = LoginStates.FORGOT_PASSWORD;
|
|
}, FORGOT_PASSWORD_SENT: function() {
|
|
env0_31 = LoginStates.NONE;
|
|
}, UPDATE_TOKEN: function({token, userId}) {
|
|
logInfo('handleUpdateToken called');
|
|
setAuthToken(token, userId);
|
|
clearFingerprint();
|
|
}, EXPERIMENTS_FETCH: function(a0) {
|
|
fetchExperiments(a0);
|
|
}, CURRENT_USER_UPDATE: CURRENT_USER_UPDATE, AGE_GATE_LOGOUT_UNDERAGE_NEW_USER: closure2,
|
|
CLOSE_SUSPENDED_USER: function() {
|
|
env0_40 = null;
|
|
env0_31 = LoginStates.NONE;
|
|
LOGOUT_13708();
|
|
global.setImmediate(_fun13759);
|
|
}, PASSWORDLESS_FAILURE: PASSWORDLESS_FAILURE, PASSWORDLESS_START: function() {
|
|
env0_41 = true;
|
|
}};
|
|
const DispatchBand = (require(694) /* metro dependency 694: Dispatcher */).DispatchBand;
|
|
const Early = DispatchBand.Early;
|
|
value = new value(dispatcher, object2, Early);
|
|
(require(2) /* metro dependency 2 */).fileFinishedImporting('stores/AuthenticationStore.tsx');
|
|
exports.default = value;
|
|
}
|
|
|
|
function _isNativeReflectConstruct_13692() { // fn#13692, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1353:341, offset: 0x00df2f2c, size: 94 bytes, params: 1, frame: 18
|
|
var Boolean;
|
|
var prototype;
|
|
var valueOf;
|
|
var call;
|
|
var Reflect;
|
|
var construct;
|
|
var closure;
|
|
var value;
|
|
var error;
|
|
try {
|
|
Boolean = global.Boolean;
|
|
prototype = Boolean.prototype;
|
|
valueOf = prototype.valueOf;
|
|
call = valueOf.call;
|
|
Reflect = global.Reflect;
|
|
construct = Reflect.construct;
|
|
Boolean = global.Boolean;
|
|
closure = function() {
|
|
};
|
|
value = Reflect.apply(construct, Reflect, [Boolean, [], closure]);
|
|
value = Reflect.apply(call, valueOf, [value]);
|
|
var result = !value;
|
|
} catch (error) {
|
|
}
|
|
return (_isNativeReflectConstruct_13692_isNativeReflectConstruct = function() {
|
|
return !!result;
|
|
})();
|
|
}
|
|
|
|
function logInfo(a0) { // fn#13695, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1353:772, offset: 0x00df2f8a, size: 114 bytes, params: 2, frame: 16
|
|
const value3 = (importAll(692) /* metro dependency 692: TokenManager */).getToken() != null;
|
|
const Storage = (require(587) /* metro dependency 587: Storage */).Storage;
|
|
const get = Storage.get;
|
|
const value4 = Reflect.apply(get, Storage, [TOKEN_KEY]) != null;
|
|
const binding = env0_19;
|
|
binding.verbose(a0, {tokenManagerHasToken: value3, storageHasToken: value4});
|
|
}
|
|
|
|
function fetchFingerprint() { // fn#13696, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1353:912, offset: 0x00df2ffc, size: 264 bytes, params: 1, frame: 17
|
|
const value = a0;
|
|
const r4 = !(value !== undefined) || value;
|
|
const Storage = (require(587) /* metro dependency 587: Storage */).Storage;
|
|
env0_27 = Storage.get(env0_20);
|
|
const value2 = Storage.get(env0_21);
|
|
const value3 = null;
|
|
let r1 = value3 != value2 ? value2 : value3;
|
|
if (value3 != env0_39) {
|
|
return env0_39;
|
|
}
|
|
r1 = value3 != env0_27 ? env0_27 : (importAll(692) /* metro dependency 692: TokenManager */).getToken();
|
|
const router_utilsModule = require(1230) /* metro dependency 1230: router_utils */;
|
|
r1 = router_utilsModule.isValidFingerprintRoute() ? r4 ? BrowserHandoffStoreNative.isHandoffAvailable() ? global.Promise.resolve() : fetchExperiments({withGuildExperiments: true}) : value3 != r1 || BrowserHandoffStoreNative.isHandoffAvailable() ? global.Promise.resolve() : fetchExperiments({withGuildExperiments: true}) : global.Promise.resolve();
|
|
return r1;
|
|
}
|
|
|
|
function fetchExperiments({withGuildExperiments}) { // fn#13697, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1353:1216, offset: 0x00df3104, size: 246 bytes, params: 2, frame: 20
|
|
let object3 = {};
|
|
const superPropertiesBase64 = (importDefault(683) /* metro dependency 683: AnalyticsUtils */).getSuperPropertiesBase64();
|
|
if (superPropertiesBase64 != null) {
|
|
object3['X-Super-Properties'] = superPropertiesBase64;
|
|
}
|
|
if (env0_27 != null) {
|
|
object3['X-Fingerprint'] = env0_27;
|
|
}
|
|
if (env0_29 != null) {
|
|
object3['X-Installation-ID'] = env0_29;
|
|
}
|
|
const HTTP = (require(507) /* metro dependency 507: HTTPUtils */).HTTP;
|
|
const get = HTTP.get;
|
|
const object4 = {};
|
|
const EXPERIMENTS = Endpoints.EXPERIMENTS;
|
|
object4.url = EXPERIMENTS;
|
|
object4.query = {with_guild_experiments: withGuildExperiments};
|
|
object4.headers = object3;
|
|
object3 = {};
|
|
object3.location = (require(1230) /* metro dependency 1230: router_utils */).getFingerprintLocation();
|
|
object4.context = object3;
|
|
object4.retries = 3;
|
|
object4.oldFormErrors = true;
|
|
object4.rejectWithError = false;
|
|
return Reflect.apply(get, HTTP, [object4]).then(_fun13698, _fun13699);
|
|
}
|
|
|
|
function clearFingerprint() { // fn#13700, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1353:2052, offset: 0x00df332d, size: 62 bytes, params: 1, frame: 12
|
|
const Storage = (require(587) /* metro dependency 587: Storage */).Storage;
|
|
Storage.remove(env0_20);
|
|
}
|
|
|
|
function setAuthToken(a0, a1) { // fn#13701, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1353:2118, offset: 0x00df336b, size: 110 bytes, params: 3, frame: 15
|
|
logInfo('setAuthToken called.');
|
|
if (!(a1 != null && a1 === env0_23)) {
|
|
(importAll(692) /* metro dependency 692: TokenManager */).removeAnalyticsToken();
|
|
}
|
|
(importAll(692) /* metro dependency 692: TokenManager */).setToken(a0, a1);
|
|
}
|
|
|
|
function setAnalyticsToken_13702(a0) { // fn#13702, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1353:2248, offset: 0x00df33d9, size: 45 bytes, params: 2, frame: 12
|
|
env0_30 = a0;
|
|
(importAll(692) /* metro dependency 692: TokenManager */).setAnalyticsToken(a0);
|
|
}
|
|
|
|
function removeAuthToken() { // fn#13703, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1353:2312, offset: 0x00df3406, size: 71 bytes, params: 1, frame: 14
|
|
logInfo('removeAuthToken called.');
|
|
(importAll(692) /* metro dependency 692: TokenManager */).removeAnalyticsToken();
|
|
return (importAll(692) /* metro dependency 692: TokenManager */).removeToken();
|
|
}
|
|
|
|
function updateMFAMethods() { // fn#13704, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1353:2436, offset: 0x00df344d, size: 135 bytes, params: 1, frame: 13
|
|
const items2 = [];
|
|
if (env0_36 != null) {
|
|
items2.push({type: 'webauthn', challenge: env0_36});
|
|
}
|
|
if (env0_37) {
|
|
items2.push({type: 'totp'});
|
|
}
|
|
if (env0_38) {
|
|
items2.push({type: 'backup'});
|
|
}
|
|
if (env0_35) {
|
|
items2.push({type: 'sms'});
|
|
}
|
|
}
|
|
|
|
function INSTALLATION_ID({installation}) { // fn#13705, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1353:2600, offset: 0x00df34d4, size: 123 bytes, params: 2, frame: 15
|
|
var defaultImport;
|
|
const Storage = (require(587) /* metro dependency 587: Storage */).Storage;
|
|
if (env0_29 == null) {
|
|
defaultImport = importDefault(12831) /* metro dependency 12831: TrackingConsentUtils */;
|
|
if (defaultImport.canUseInstallationId()) {
|
|
Storage.set(env0_21, installation);
|
|
}
|
|
} else {
|
|
if (env0_29.length > 0) {
|
|
return false;
|
|
}
|
|
defaultImport = importDefault(12831) /* metro dependency 12831: TrackingConsentUtils */;
|
|
if (defaultImport.canUseInstallationId()) {
|
|
Storage.set(env0_21, installation);
|
|
}
|
|
}
|
|
}
|
|
|
|
function AGE_GATE_LOGOUT_UNDERAGE_NEW_USER() { // fn#13706, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1353:2743, offset: 0x00df354f, size: 59 bytes, params: 1, frame: 12
|
|
LOGOUT_13708();
|
|
(importDefault(694) /* metro dependency 694: Dispatcher */).wait(function() {
|
|
require(dependencyMap[12]).transitionTo(Routes.REGISTER);
|
|
});
|
|
}
|
|
|
|
function LOGOUT_13708(a0) { // fn#13708, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1353:2853, offset: 0x00df35ba, size: 359 bytes, params: 2, frame: 19
|
|
const logInfoBinding = logInfo;
|
|
const value2 = undefined;
|
|
logInfoBinding('handleLogout called.');
|
|
const value3 = removeAuthToken();
|
|
const isSwitchingAccount = a0 == null ? value2 : a0.isSwitchingAccount;
|
|
if (!(isSwitchingAccount != null && isSwitchingAccount)) {
|
|
if (value3) {
|
|
clearFingerprint();
|
|
}
|
|
fetchFingerprint();
|
|
}
|
|
const PersistedStore = (importDefault(566) /* metro dependency 566: flux */).PersistedStore;
|
|
PersistedStore.clearAll({omit: ['InstallationManagerStore', 'AgeGateStore', 'NativePermissionsStore',
|
|
'MultiAccountStore', 'DraftStore', 'OverlayStoreV2', 'StreamerModeStore', 'LoginRequiredActionStore',
|
|
'LayoutStore', 'OverlaySettingsStore', 'ApexExperimentStore'],
|
|
type: a0 != null && a0.isSwitchingAccount ? 'user-data-only' : 'all'});
|
|
const Store = (importDefault(566) /* metro dependency 566: flux */).Store;
|
|
Store.removeAllConditionalListeners();
|
|
MobileCacheSnapshotStore.clearAll();
|
|
(importDefault(1216) /* metro dependency 1216: SentryUtilsNative */).clearUser();
|
|
const Storage = (require(587) /* metro dependency 587: Storage */).Storage;
|
|
Storage.remove(env0_22);
|
|
env0_31 = a0 == null ? LoginStates.NONE : a0.isSwitchingAccount ? LoginStates.LOGGING_IN : LoginStates.NONE;
|
|
updateMFAMethods();
|
|
return value2;
|
|
}
|
|
|
|
function _fun13709(a0) { // fn#13709, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1353:3583, offset: 0x00df3721, size: 521 bytes, params: 2, frame: 16
|
|
const closure = AuthenticationStore;
|
|
env0_8(closure, a0);
|
|
return env0_5(closure, [{key: 'initialize', value: value_13711}, {key: 'getLoginStatus', value: function() {
|
|
return NONE;
|
|
}}, {key: 'getId', value: value_13715}, {key: 'getSessionId', value: value_13716}, {key: 'getAuthSessionIdHash',
|
|
value: value_13717}, {key: 'getStaticAuthSessionId', value: value_13718}, {key: 'getToken', value: value_13719},
|
|
{key: 'isAuthenticated', value: value_13720}, {key: 'getFingerprint', value: value_13721},
|
|
{key: 'getInstallationForTracking', value: value_13722}, {key: 'getAnalyticsToken', value: value_13723},
|
|
{key: 'getMFATicket', value: value_13724}, {key: 'getMFAMethods', value: value_13725},
|
|
{key: 'getLoginInstanceId', value: value_13726}, {key: 'hasTOTPEnabled', value: value_13727},
|
|
{key: 'getCredentials', value: value_13728}, {key: 'allowLogoutRedirect', value: value_13729},
|
|
{key: 'getSuspendedUserToken', value: value_13730}, {key: 'getIsPasswordlessActive', value: value_13731},
|
|
{key: 'attemptedPasswordLogin', value: value_13732}]);
|
|
}
|
|
|
|
function CONNECTION_OPEN_13733({user, sessionId, authSessionIdHash, analyticsToken, auth, staticAuthSessionId, apexExperiments}) { // fn#13733, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1353:5518, offset: 0x00df3c43, size: 450 bytes, params: 2, frame: 29
|
|
var authenticator_types;
|
|
var defaultImport2;
|
|
var track;
|
|
logInfo('handleConnectionOpen called');
|
|
const defaultImport = importDefault(1216) /* metro dependency 1216: SentryUtilsNative */;
|
|
const setUser = defaultImport.setUser;
|
|
let id = user.id;
|
|
const username = user.username;
|
|
Reflect.apply(setUser, defaultImport, [id, username, user.email ?? undefined,
|
|
(importDefault(11878) /* metro dependency 11878: isStaffFromRawUser */)(user)]);
|
|
setAnalyticsToken_13702(analyticsToken);
|
|
id = user.id;
|
|
if (auth !== undefined) {
|
|
authenticator_types = auth.authenticator_types;
|
|
}
|
|
const Storage = (require(587) /* metro dependency 587: Storage */).Storage;
|
|
let set = Storage.set;
|
|
Reflect.apply(set, Storage, [env0_22, user.id]);
|
|
if (apexExperiments?.installation != null) {
|
|
INSTALLATION_ID({type: 'INSTALLATION_ID', installation: apexExperiments.installation});
|
|
}
|
|
const get = Storage.get;
|
|
let APP_FIRST_LOGIN = AnalyticEvents.APP_FIRST_LOGIN;
|
|
if (Reflect.apply(get, Storage, [APP_FIRST_LOGIN, true])) {
|
|
defaultImport2 = importDefault(683) /* metro dependency 683: AnalyticsUtils */;
|
|
track = defaultImport2.track;
|
|
APP_FIRST_LOGIN = AnalyticEvents.APP_FIRST_LOGIN;
|
|
Reflect.apply(track, defaultImport2, [APP_FIRST_LOGIN, {platform: Platforms.IOS}]);
|
|
set = Storage.set;
|
|
APP_FIRST_LOGIN = AnalyticEvents.APP_FIRST_LOGIN;
|
|
Reflect.apply(set, Storage, [APP_FIRST_LOGIN, false]);
|
|
}
|
|
}
|
|
|
|
function OVERLAY_INITIALIZE({user, sessionId, analyticsToken, token}) { // fn#13734, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1353:6183, offset: 0x00df3e05, size: 230 bytes, params: 2, frame: 26
|
|
const defaultImport = importDefault(1216) /* metro dependency 1216: SentryUtilsNative */;
|
|
const setUser = defaultImport.setUser;
|
|
let id = user.id;
|
|
const username = user.username;
|
|
Reflect.apply(setUser, defaultImport, [id, username, user.email ?? undefined,
|
|
(importDefault(11878) /* metro dependency 11878: isStaffFromRawUser */)(user)]);
|
|
setAuthToken(token, user.id);
|
|
if (analyticsToken != null) {
|
|
setAnalyticsToken_13702(analyticsToken);
|
|
}
|
|
clearFingerprint();
|
|
id = user.id;
|
|
const Storage = (require(587) /* metro dependency 587: Storage */).Storage;
|
|
Storage.set(env0_22, user.id);
|
|
}
|
|
|
|
function CONNECTION_CLOSED({code}) { // fn#13735, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1353:6475, offset: 0x00df3eeb, size: 190 bytes, params: 2, frame: 19
|
|
logInfo('handleConnectionClosed called with code ' + code + '.');
|
|
if (code === 4004) {
|
|
if (env0_32) {
|
|
AGE_GATE_LOGOUT_UNDERAGE_NEW_USER();
|
|
return undefined;
|
|
}
|
|
var defaultImport = importDefault(683) /* metro dependency 683: AnalyticsUtils */;
|
|
var track = defaultImport.track;
|
|
var APP_USER_DEAUTHENTICATED = AnalyticEvents.APP_USER_DEAUTHENTICATED;
|
|
var object2 = {};
|
|
var Storage = (require(587) /* metro dependency 587: Storage */).Storage;
|
|
object2.user_id = Storage.get(env0_22);
|
|
Reflect.apply(track, defaultImport, [APP_USER_DEAUTHENTICATED, object2]);
|
|
LOGOUT_13708();
|
|
global.setImmediate(function() {
|
|
return require(dependencyMap[12]).transitionTo(Routes.DEFAULT_LOGGED_OUT);
|
|
});
|
|
}
|
|
}
|
|
|
|
function AUTH_SESSION_CHANGE({authSessionIdHash}) { // fn#13737, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1353:6806, offset: 0x00df3fd9, size: 26 bytes, params: 2, frame: 2
|
|
if (authSessionIdHash == null) {
|
|
}
|
|
}
|
|
|
|
function LOGIN({isPasswordAttempt}) { // fn#13738, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1353:6884, offset: 0x00df3ff3, size: 47 bytes, params: 2, frame: 4
|
|
env0_31 = LoginStates.LOGGING_IN;
|
|
env0_42 = env0_42 || isPasswordAttempt === true;
|
|
}
|
|
|
|
function LOGIN_MFA_STEP({ticket, sms, webauthn, backup, totp, loginInstanceId}) { // fn#13741, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1353:7333, offset: 0x00df40e7, size: 115 bytes, params: 2, frame: 15
|
|
var r4;
|
|
if (ticket != null) {
|
|
r4 = webauthn ?? null;
|
|
updateMFAMethods();
|
|
}
|
|
env0_31 = LoginStates.MFA_STEP;
|
|
}
|
|
|
|
function LOGIN_SUSPENDED_USER({suspendedUserToken}) { // fn#13749, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1353:8334, offset: 0x00df4264, size: 46 bytes, params: 2, frame: 11
|
|
global.setImmediate(function() {
|
|
return require(dependencyMap[12]).transitionTo(Routes.ACCOUNT_STANDING);
|
|
});
|
|
}
|
|
|
|
function FINGERPRINT({fingerprint}) { // fn#13751, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1353:8496, offset: 0x00df42c2, size: 365 bytes, params: 2, frame: 23
|
|
var defaultImport;
|
|
var track;
|
|
var EXTERNAL_FINGERPRINT_DROPPED;
|
|
var object2;
|
|
var defaultImport2;
|
|
var USER_FINGERPRINT_CHANGED;
|
|
var Storage;
|
|
if (env0_27 == null) {
|
|
if (fingerprint != null) {
|
|
defaultImport2 = importDefault(683) /* metro dependency 683: AnalyticsUtils */;
|
|
track = defaultImport2.track;
|
|
USER_FINGERPRINT_CHANGED = AnalyticEvents.USER_FINGERPRINT_CHANGED;
|
|
object2 = {};
|
|
object2.old_fingerprint = env0_28 != null ? (require(490) /* metro dependency 490: FingerprintUtils */).extractId(env0_28) : null;
|
|
object2.new_fingerprint = (require(490) /* metro dependency 490: FingerprintUtils */).extractId(fingerprint);
|
|
Reflect.apply(track, defaultImport2, [USER_FINGERPRINT_CHANGED, object2]);
|
|
env0_27 = fingerprint;
|
|
Storage = (require(587) /* metro dependency 587: Storage */).Storage;
|
|
Storage.set(env0_20, env0_27);
|
|
} else {
|
|
fetchFingerprint();
|
|
}
|
|
} else if (fingerprint != null && env0_27 !== fingerprint) {
|
|
defaultImport = importDefault(683) /* metro dependency 683: AnalyticsUtils */;
|
|
track = defaultImport.track;
|
|
EXTERNAL_FINGERPRINT_DROPPED = AnalyticEvents.EXTERNAL_FINGERPRINT_DROPPED;
|
|
object2 = {};
|
|
object2.fingerprint = (require(490) /* metro dependency 490: FingerprintUtils */).extractId(env0_27);
|
|
object2.dropped_fingerprint = (require(490) /* metro dependency 490: FingerprintUtils */).extractId(fingerprint);
|
|
Reflect.apply(track, defaultImport, [EXTERNAL_FINGERPRINT_DROPPED, object2]);
|
|
}
|
|
}
|
|
|
|
function CURRENT_USER_UPDATE({user}) { // fn#13757, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1353:9373, offset: 0x00df44ae, size: 90 bytes, params: 2, frame: 15
|
|
const id = user.id;
|
|
let authenticator_types = user.authenticator_types;
|
|
if (authenticator_types !== undefined) {
|
|
authenticator_types = user.authenticator_types;
|
|
}
|
|
const Storage = (require(587) /* metro dependency 587: Storage */).Storage;
|
|
Storage.set(env0_22, user.id);
|
|
}
|
|
|
|
function CLOSE_SUSPENDED_USER() { // fn#13758, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1353:9581, offset: 0x00df4508, size: 55 bytes, params: 1, frame: 11
|
|
env0_31 = LoginStates.NONE;
|
|
LOGOUT_13708();
|
|
global.setImmediate(function() {
|
|
return require(dependencyMap[12]).transitionTo(Routes.DEFAULT_LOGGED_OUT);
|
|
});
|
|
}
|
|
|
|
function PASSWORDLESS_FAILURE({error}) { // fn#13760, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1353:9735, offset: 0x00df453f, size: 153 bytes, params: 2, frame: 15
|
|
var r1;
|
|
var NONE;
|
|
var moduleValue;
|
|
if (error instanceof (importDefault(4132) /* metro dependency 4132: APIError */)) {
|
|
moduleValue = require(8977) /* metro dependency 8977: getAuthenticationErrorsFromAPIError */;
|
|
r1 = moduleValue.getAuthenticationErrorsFromAPIError(error).date_of_birth != null ? LoginStates.LOGIN_AGE_GATE : LoginStates.NONE;
|
|
} else {
|
|
NONE = LoginStates.NONE;
|
|
}
|
|
}
|
|
|
|
function _fun13698({body}) { // fn#13698, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1353:1616, offset: 0x00df31fa, size: 252 bytes, params: 2, frame: 19
|
|
const fingerprint = body.fingerprint;
|
|
const assignments = body.assignments;
|
|
const guild_experiments = body.guild_experiments;
|
|
const installation = body.installation;
|
|
let value = installation != null;
|
|
if (value && installation.length > 0) {
|
|
value = environment.__proto__;
|
|
value = importDefault(694) /* metro dependency 694: Dispatcher */;
|
|
value.dispatch({type: 'INSTALLATION_ID', installation: installation});
|
|
}
|
|
if (fingerprint) {
|
|
value = environment.__proto__;
|
|
value = importDefault(694) /* metro dependency 694: Dispatcher */;
|
|
value.dispatch({type: 'FINGERPRINT', fingerprint: fingerprint});
|
|
}
|
|
value = environment.__proto__;
|
|
const defaultImport = importDefault(694) /* metro dependency 694: Dispatcher */;
|
|
defaultImport.dispatch({type: 'EXPERIMENTS_FETCH_SUCCESS', fingerprint: fingerprint, experiments: assignments,
|
|
guildExperiments: guild_experiments});
|
|
(require(12830) /* metro dependency 12830: awaitExperiments */).onExperimentsLoaded();
|
|
}
|
|
|
|
function _fun13699() { // fn#13699, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1353:1983, offset: 0x00df32f6, size: 55 bytes, params: 1, frame: 13
|
|
const value = environment.__proto__;
|
|
(importDefault(694) /* metro dependency 694: Dispatcher */).dispatch({type: 'EXPERIMENTS_FETCH_FAILURE'});
|
|
}
|
|
|
|
function AuthenticationStore() { // fn#13710, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1353:3595, offset: 0x00df392a, size: 113 bytes, params: 1, frame: 20
|
|
const value = environment.__proto__;
|
|
env1_4(this, AuthenticationStore);
|
|
const value3 = env1_7(AuthenticationStore);
|
|
return env1_6(this, _isNativeReflectConstruct_13692() ? global.Reflect.construct(value3, arguments,
|
|
env1_7(this).constructor) : value3.apply(this, arguments));
|
|
}
|
|
|
|
function value_13711() { // fn#13711, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1353:3908, offset: 0x00df399b, size: 206 bytes, params: 1, frame: 19
|
|
var environment;
|
|
var closure;
|
|
const value = environment.__proto__;
|
|
const Storage = (require(587) /* metro dependency 587: Storage */).Storage;
|
|
env1_23 = Storage.get(env1_22);
|
|
const value2 = Storage.get(env1_21);
|
|
const value3 = null;
|
|
env1_29 = value3 != value2 ? value2 : value3;
|
|
const tokenManagerModule = importAll(692) /* metro dependency 692: TokenManager */;
|
|
const getToken = tokenManagerModule.getToken;
|
|
if (value3 == Reflect.apply(getToken, tokenManagerModule, [])) {
|
|
if (value3 == env1_29 || env1_29.length === 0) {
|
|
closure = fireApex;
|
|
fetchFingerprint().then(closure, closure);
|
|
}
|
|
}
|
|
this.addChangeListener(_fun13713);
|
|
}
|
|
|
|
function value_13719() { // fn#13719, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1353:4503, offset: 0x00df3ae8, size: 37 bytes, params: 1, frame: 11
|
|
const value = environment.__proto__;
|
|
return (require(1355) /* metro dependency 1355: AuthenticationUtils */).getToken();
|
|
}
|
|
|
|
function value_13720() { // fn#13720, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1353:4572, offset: 0x00df3b0d, size: 37 bytes, params: 1, frame: 11
|
|
const value = environment.__proto__;
|
|
return (require(1355) /* metro dependency 1355: AuthenticationUtils */).isAuthenticated();
|
|
}
|
|
|
|
function value_13722() { // fn#13722, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1353:4709, offset: 0x00df3b3b, size: 46 bytes, params: 1, frame: 12
|
|
return (importDefault(12831) /* metro dependency 12831: TrackingConsentUtils */).canUseInstallationId() ? env1_29 : null;
|
|
}
|
|
|
|
function value_13723() { // fn#13723, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1353:4799, offset: 0x00df3b69, size: 53 bytes, params: 1, frame: 12
|
|
var r0;
|
|
let value = environment.__proto__;
|
|
if (env1_30 != null) {
|
|
r0 = env1_30;
|
|
} else {
|
|
value = importAll(692) /* metro dependency 692: TokenManager */;
|
|
value = value.getAnalyticsToken();
|
|
r0 = value;
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
function value_13727() { // fn#13727, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1353:5037, offset: 0x00df3bb0, size: 53 bytes, params: 1, frame: 13
|
|
const binding = env1_33;
|
|
const includes = binding.includes;
|
|
const AuthenticatorType = (require(1909) /* metro dependency 1909: Server */).AuthenticatorType;
|
|
const TOTP = AuthenticatorType.TOTP;
|
|
return Reflect.apply(includes, binding, [TOTP]);
|
|
}
|
|
|
|
function value_13728() { // fn#13728, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1353:5129, offset: 0x00df3be5, size: 55 bytes, params: 1, frame: 11
|
|
const value = environment.__proto__;
|
|
if (env1_17 == null) {
|
|
throw new global.Error('no credentials');
|
|
}
|
|
return env1_17;
|
|
}
|
|
|
|
function value_13729() { // fn#13729, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1353:5229, offset: 0x00df3c1c, size: 12 bytes, params: 1, frame: 1
|
|
return !env1_32;
|
|
}
|
|
|
|
function fireApex() { // fn#13712, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1353:4092, owner: value_13711.fireApex, offset: 0x00df3a69, size: 40 bytes, params: 1, frame: 12
|
|
const value = environment.__proto__.__proto__;
|
|
(require(10566) /* metro dependency 10566: ApexActionCreators */).fetchInstallationExperiments(null);
|
|
}
|
|
|
|
function _fun13713() { // fn#13713, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1353:4193, offset: 0x00df3a91, size: 42 bytes, params: 1, frame: 12
|
|
return (require(12832) /* metro dependency 12832: ClientStateStoreStorageNative */).setClientState(env2_23);
|
|
}
|
|
|