Skip to content

Commit

Permalink
MOBILE-4201 login: Do not show other auth methods or signup if sso
Browse files Browse the repository at this point in the history
  • Loading branch information
crazyserver committed Sep 14, 2023
1 parent 6e2840f commit 6a720d9
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ export class CoreLoginMethodsComponent implements OnInit {
@Input() siteConfig?: CoreSitePublicConfigResponse;
@Input() redirectData?: CoreRedirectPayload;

isBrowserSSO = false;
showScanQR = false;
loginMethods: CoreLoginMethod[] = [];
identityProviders: CoreSiteIdentityProvider[] = [];
Expand All @@ -50,9 +51,14 @@ export class CoreLoginMethodsComponent implements OnInit {
}

if (this.siteConfig) {
const disabledFeatures = CoreLoginHelper.getDisabledFeatures(this.siteConfig);
this.isBrowserSSO = CoreLoginHelper.isSSOLoginNeeded(this.siteConfig.typeoflogin);

this.identityProviders = CoreLoginHelper.getValidIdentityProviders(this.siteConfig, disabledFeatures);
if (!this.isBrowserSSO) {
// Identity providers won't be shown if login on browser.
const disabledFeatures = CoreLoginHelper.getDisabledFeatures(this.siteConfig);

this.identityProviders = CoreLoginHelper.getValidIdentityProviders(this.siteConfig, disabledFeatures);
}

if (this.reconnect) {
this.showScanQR = CoreLoginHelper.displayQRInSiteScreen();
Expand Down
10 changes: 5 additions & 5 deletions src/core/features/login/pages/credentials/credentials.html
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ <h2 *ngIf="siteName" class="ion-margin-top ion-no-padding core-sitename">
<core-login-methods *ngIf="siteConfig" [siteConfig]="siteConfig" [siteUrl]="siteUrl"></core-login-methods>
</div>

<div class="core-login-sign-up" *ngIf="canSignup || authInstructions">
<div class="core-login-sign-up" *ngIf="!isBrowserSSO && (canSignup || authInstructions)">
<h2>{{ 'core.login.firsttime' | translate }}</h2>

<ion-item class="ion-text-wrap ion-no-padding core-login-instructions">
Expand All @@ -95,12 +95,12 @@ <h2>{{ 'core.login.firsttime' | translate }}</h2>
</ion-label>
</ion-item>


<ion-button *ngIf="canSignup" expand="block" class="ion-margin ion-text-wrap" fill="outline" (click)="openEmailSignup()">
{{ 'core.login.startsignup' | translate }}
</ion-button>
</div>
<ion-button *ngIf="canSignup" expand="block" class="ion-margin ion-text-wrap" fill="outline" (click)="openEmailSignup()">
{{ 'core.login.startsignup' | translate }}
</ion-button>
</ng-container>

<core-empty-box *ngIf="siteCheckError" icon="fas-circle-exclamation" [message]="siteCheckError">
<ion-button expand="block" (click)="checkSite()" fill="outline">
{{ 'core.tryagain' | translate }}
Expand Down

0 comments on commit 6a720d9

Please sign in to comment.