[MNT-21636] Fix redirect URL for viewer (#6564)

* fix redirect URL for viewer

* fix unit
fix login SSO show when user is logged in

* update js-api

* remove protractor change
This commit is contained in:
Eugenio Romano
2021-01-22 17:17:14 +00:00
committed by GitHub
parent b126c14a07
commit 8f0633b133
9 changed files with 99 additions and 65 deletions

View File

@@ -150,20 +150,21 @@ export class LoginComponent implements OnInit, OnDestroy {
this.initFormFieldsDefault();
this.initFormFieldsMessages();
if (this.authService.isOauth()) {
const oauth: OauthConfigModel = this.appConfig.get<OauthConfigModel>(AppConfigValues.OAUTHCONFIG, null);
if (oauth && oauth.implicitFlow) {
this.implicitFlow = true;
}
if (oauth && oauth.silentLogin && !this.authService.isLoggedIn()) {
this.alfrescoApiService.getInstance().oauth2Auth.implicitLogin();
}
}
if (this.authService.isLoggedIn()) {
this.router.navigate([this.successRoute]);
} else {
if (this.authService.isOauth()) {
const oauth: OauthConfigModel = this.appConfig.get<OauthConfigModel>(AppConfigValues.OAUTHCONFIG, null);
if (oauth && oauth.implicitFlow) {
this.implicitFlow = true;
}
if (oauth && oauth.silentLogin) {
this.alfrescoApiService.getInstance().oauth2Auth.implicitLogin();
}
}
this.route.queryParams.subscribe((params: Params) => {
const url = params['redirectUrl'];
const provider = this.appConfig.get<string>(AppConfigValues.PROVIDERS);