MOBILE-4653 login: Improvements to easily change classes and logins

main
Pau Ferrer Ocaña 2024-11-18 13:17:23 +01:00
parent 0a37db2151
commit f1a488d1e6
2 changed files with 9 additions and 9 deletions

View File

@ -796,20 +796,20 @@ export class CoreLoginHelperProvider {
launchUrl = launchUrl || siteUrl + '/admin/tool/mobile/launch.php';
const passport = Math.random() * 1000;
let loginUrl = launchUrl + '?service=' + service;
loginUrl += '&passport=' + passport;
loginUrl += '&urlscheme=' + CoreConstants.CONFIG.customurlscheme;
const additionalParams = Object.assign(urlParams || {}, {
service,
passport,
urlscheme: CoreConstants.CONFIG.customurlscheme,
});
if (urlParams) {
loginUrl = CoreUrl.addParamsToUrl(loginUrl, urlParams);
}
const loginUrl = CoreUrl.addParamsToUrl(launchUrl, additionalParams);
// Store the siteurl and passport in CoreConfig for persistence.
// We are "configuring" the app to wait for an SSO. CoreConfig shouldn't be used as a temporary storage.
await CoreConfig.set(CoreConstants.LOGIN_LAUNCH_DATA, JSON.stringify(<StoredLoginLaunchData> {
siteUrl: siteUrl,
passport: passport,
siteUrl,
passport,
...redirectData,
ssoUrlParams: urlParams || {},
}));

View File

@ -89,7 +89,7 @@ export class CoreHTMLClasses {
*
* @param prefixes Prefixes of the class mode to be removed.
*/
protected static removeModeClasses(prefixes: string[]): void {
static removeModeClasses(prefixes: string[]): void {
for (const modeClass of CoreHTMLClasses.getModeClasses()) {
if (!prefixes.some((prefix) => modeClass.startsWith(prefix))) {
continue;