From d95fdafc70920cf1818f04bf48afb7f35d443875 Mon Sep 17 00:00:00 2001 From: Alex ORLUC <alex.orluc@maarch.org> Date: Fri, 16 Oct 2020 14:54:24 +0200 Subject: [PATCH] FEAT #13695 TIME 0:05 remove test --- src/frontend/app/login/login.component.ts | 13 ++++++------- src/frontend/service/auth.service.ts | 2 +- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/src/frontend/app/login/login.component.ts b/src/frontend/app/login/login.component.ts index 41b45674dd4..f67a282c5fd 100644 --- a/src/frontend/app/login/login.component.ts +++ b/src/frontend/app/login/login.component.ts @@ -109,24 +109,23 @@ export class LoginComponent implements OnInit { this.http.get('../rest/authenticationInformations').pipe( tap((data: any) => { this.authService.setAppSession(data.instanceId); - // this.authService.authMode = data.connection; this.authService.changeKey = data.changeKey; this.applicationName = data.applicationName; this.loginMessage = data.loginMessage; this.authService.setEvent('authenticationInformations'); - - // FOR TEST - this.authService.authMode = 'cas'; - this.authService.authUrl = 'https://10.2.95.72:8443/cas-server-webapp-4.0.0/login?service=http://localhost/maarch_courrier_develop/cs_recette/dist/index.html#/login'; + this.authService.authMode = data.authMode; + this.authService.authUri = data.authUri; if (['cas', 'keycloak'].indexOf(this.authService.authMode) > -1) { this.loginForm.disable(); this.loginForm.setValidators(null); const regex = /ticket=[.]*/g; if (window.location.search.match(regex) !== null) { - this.onSubmit(window.location.search.substring(1, window.location.search.length)); + const ssoToken = window.location.search.substring(1, window.location.search.length); + window.location.search = ''; + this.onSubmit(ssoToken); } else { - window.location.href = this.authService.authUrl; + window.location.href = this.authService.authUri; } } }), diff --git a/src/frontend/service/auth.service.ts b/src/frontend/service/auth.service.ts index d913662d2df..6f55e47f48e 100644 --- a/src/frontend/service/auth.service.ts +++ b/src/frontend/service/auth.service.ts @@ -12,7 +12,7 @@ import { Observable, Subject } from 'rxjs'; export class AuthService { authMode: string = 'default'; - authUrl: string = ''; + authUri: string = ''; changeKey: boolean = null; user: any = {}; private eventAction = new Subject<any>(); -- GitLab