Skip to content

Commit

Permalink
MOBILE-4201 login: Reintroduce the skip confirmation when SSO login
Browse files Browse the repository at this point in the history
  • Loading branch information
crazyserver committed Sep 20, 2023
1 parent 6f6b8f2 commit 8f7e153
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
4 changes: 4 additions & 0 deletions src/core/features/login/pages/credentials/credentials.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,10 @@ export class CoreLoginCredentialsPage implements OnInit, OnDestroy {

await this.checkSite();

if (this.isBrowserSSO && CoreLoginHelper.shouldSkipCredentialsScreenOnSSO()) {
this.openBrowserSSO();
}

if (CorePlatform.isIOS() && !this.isBrowserSSO) {
// Make iOS auto-fill work. The field that isn't focused doesn't get updated, do it manually.
// Debounce it to prevent triggering this function too often when the user is typing.
Expand Down
14 changes: 11 additions & 3 deletions src/core/features/login/services/login-helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -903,11 +903,19 @@ export class CoreLoginHelperProvider {
*
* @param typeOfLogin TypeOfLogin.BROWSER or TypeOfLogin.EMBEDDED.
* @returns True if confirm modal should be shown, false otherwise.
* @deprecated since 4.3 Not used anymore.
* @deprecated since 4.3 Not used anymore. See shouldSkipCredentialsScreenOnSSO.
*/
// eslint-disable-next-line @typescript-eslint/no-unused-vars
shouldShowSSOConfirm(typeOfLogin: TypeOfLogin): boolean {
return false;
return !this.isSSOEmbeddedBrowser(typeOfLogin) && !this.shouldSkipCredentialsScreenOnSSO();
}

/**
* Check if we can skip credentials page.
*
* @returns If true, the browser should be opened without the user prompt.
*/
shouldSkipCredentialsScreenOnSSO(): boolean {
return String(CoreConstants.CONFIG.skipssoconfirmation) === 'true';
}

/**
Expand Down
1 change: 1 addition & 0 deletions src/types/config.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ export interface EnvironmentConfig {
multisitesdisplay: CoreLoginSiteSelectorListMethod;
sitefindersettings: Partial<CoreLoginSiteFinderSettings>;
onlyallowlistedsites: boolean;
skipssoconfirmation: boolean;
forcedefaultlanguage: boolean;
privacypolicy: string;
notificoncolor: string;
Expand Down

0 comments on commit 8f7e153

Please sign in to comment.