86 lines
3.2 KiB
TypeScript
86 lines
3.2 KiB
TypeScript
// Module ID: 9580
|
|
// Function ID: 9581
|
|
// Name: authorizeCallback
|
|
// Dependencies: [9579, 4763, 9254, 1896, 1365, 9581, 4525, 1093, 4255, 2]
|
|
// Exports: default
|
|
|
|
// Module 9580 (authorizeCallback)
|
|
import set from "set" /* 2 */;
|
|
import keys from "keys" /* 1093 */;
|
|
import isDiscordProxiedAssetUrlDefault from "isDiscordProxiedAssetUrl" /* 1365 */;
|
|
import asyncRequireImpl from "asyncRequireImpl" /* 1896 */;
|
|
import _modDef4255 from "module_4255" /* 4255 */;
|
|
import NativeModules from "NativeModules" /* 4525 */;
|
|
import _modDef4763 from "module_4763" /* 4763 */;
|
|
import OAUTH2_AUTHORIZE_MODAL_KEY from "OAUTH2_AUTHORIZE_MODAL_KEY" /* 9579 */;
|
|
|
|
({ OAUTH2_SUCCESS_RESULT_MODAL_KEY: c3, OAUTH2_ERROR_RESULT_MODAL_KEY: c4 } = OAUTH2_AUTHORIZE_MODAL_KEY);
|
|
const re5 = /oauth2\/authorized/;
|
|
const re6 = /oauth2\/error/;
|
|
const result = set.fileFinishedImporting("modules/oauth2/native/authorizeCallback.tsx");
|
|
|
|
export default function authorizeCallback(arg0) {
|
|
({ location: _location, canceled, wasDeepLink } = arg0);
|
|
if (null != _location) {
|
|
let toURLSafeResult = isDiscordProxiedAssetUrlDefault.toURLSafe(_location);
|
|
if (toURLSafeResult == null) {
|
|
toURLSafeResult = {};
|
|
}
|
|
({ host, pathname, searchParams } = toURLSafeResult);
|
|
if (null != host) {
|
|
let tmp8Result = tmp8(1365);
|
|
if (tmp8Result.isDiscordHostname(host)) {
|
|
if (null != pathname) {
|
|
if (null != pathname.match(closure_5)) {
|
|
tmp8Result = tmp8(4763);
|
|
let obj = { application: null, guild: null };
|
|
obj[0] = tmp;
|
|
obj[1] = tmp2;
|
|
tmp8Result.pushLazy(asyncRequireImpl(9581, tmp9.paths), obj, closure_3);
|
|
} else if (null != pathname.match(closure_6)) {
|
|
if (!canceled) {
|
|
let str;
|
|
const tmp8Result1 = tmp8(4763);
|
|
if (searchParams != null) {
|
|
str = "error_description";
|
|
const str2 = searchParams.get("error_description");
|
|
if (str2 != null) {
|
|
str = str2.toString();
|
|
}
|
|
}
|
|
if (str == null) {
|
|
let str1;
|
|
if (searchParams != null) {
|
|
const str4 = searchParams.get("error");
|
|
if (str4 != null) {
|
|
str1 = str4.toString();
|
|
}
|
|
}
|
|
str = str1;
|
|
}
|
|
obj = { error: null };
|
|
obj[0] = str;
|
|
tmp8Result1.pushLazy(asyncRequireImpl(9254, tmp9.paths), obj, closure_4);
|
|
const tmp17 = asyncRequireImpl(9254, tmp9.paths);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
if (wasDeepLink) {
|
|
const browserManagerSelectedBrowser = NativeModules.getBrowserManagerSelectedBrowser();
|
|
wasDeepLink = browserManagerSelectedBrowser === keys.WebBrowserType.IN_APP;
|
|
const obj5 = NativeModules;
|
|
}
|
|
const obj2 = isDiscordProxiedAssetUrlDefault;
|
|
let SAFARI;
|
|
if (wasDeepLink) {
|
|
SAFARI = keys.WebBrowserType.SAFARI;
|
|
}
|
|
_modDef4255.openURL(_location, SAFARI);
|
|
const tmp8Result2 = _modDef4255;
|
|
} else if (!canceled) {
|
|
obj = _modDef4763;
|
|
obj.pushLazy(asyncRequireImpl(9254, dependencyMap.paths), undefined, closure_4);
|
|
}
|
|
};
|