Skip to content

Commit

Permalink
MOBILE-4653 login: Improvements to easily change classes and logins
Browse files Browse the repository at this point in the history
  • Loading branch information
crazyserver committed Nov 18, 2024
1 parent 0a37db2 commit f1a488d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
16 changes: 8 additions & 8 deletions src/core/features/login/services/login-helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 || {},
}));
Expand Down
2 changes: 1 addition & 1 deletion src/core/singletons/html-classes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit f1a488d

Please sign in to comment.