diff --git a/Dockerfile b/Dockerfile index 358d368..5ee92b7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -70,7 +70,7 @@ RUN apk add --no-cache wget ENV LANG=C.UTF-8 COPY --from=buildBack /tmp/out/maven/*.jar /application/application.jar -COPY --from=buildFront /tmp/dist /application/karideo/ +COPY --from=buildFront /tmp/dist /application/front/ WORKDIR /application/ diff --git a/front/src/app/app.component.ts b/front/src/app/app.component.ts index 65dd93d..08feba7 100644 --- a/front/src/app/app.component.ts +++ b/front/src/app/app.component.ts @@ -58,14 +58,17 @@ export class AppComponent implements OnInit { self.isConnected = isConnected; self.autoConnectedDone = true; self.updateMainMenu(); + if (isConnected) { + console.log("Is connected then back to the requested page") + self.router.navigateByUrl(self.location); + console.log(`update global URL = ${self.location}`); + } }); this.ssoService.checkSignUpEnable() .then((value: boolean) => { console.log(`Get value signUp = ${value}`); self.signUpEnable = value; self.updateMainMenu(); - self.router.navigateByUrl(self.location); - console.log(`update global URL = ${self.location}`); }).catch((error: any) => { console.log(`Can not call the sso to check the sign-up_interface: ${error}`); }); diff --git a/front/src/common/service/session.ts b/front/src/common/service/session.ts index 31a61a5..4161f4c 100644 --- a/front/src/common/service/session.ts +++ b/front/src/common/service/session.ts @@ -48,7 +48,7 @@ export class SessionService { userBlocked: boolean; userRemoved: boolean; userAvatar: string; - tokenJwt?: string; + tokenJwt: string; }) { console.log(`Session Create: userId=${userId} userLogin=${userLogin} userEMail=${userEMail} userAdmin=${userAdmin} userAvatar=${userAvatar} sessionId = ${sessionId} tokenJwt = ${tokenJwt}`); this.tokenJwt = tokenJwt; @@ -76,9 +76,6 @@ export class SessionService { this.userAvatar = null; this.change.emit(false); } - setToken(jwt: string) { - this.tokenJwt = jwt; - } getToken(): string | undefined { return this.tokenJwt; } diff --git a/front/src/common/service/sso.ts b/front/src/common/service/sso.ts index bcbd72a..2899059 100644 --- a/front/src/common/service/sso.ts +++ b/front/src/common/service/sso.ts @@ -30,7 +30,7 @@ export class SSOService { * Request SSO connection */ hashLocalData(data?: string): string { - if (!isNullOrUndefined(data) && !isInArray(data, ["", "null", "NULL", "undefined", "---"])) { + if (!isNullOrUndefined(data) && !isInArray(data, ["", "null", "NULL", "undefined", "---", "unregistered", "unregistered/", "forbidden", "forbidden/"])) { return this.utf8_to_b64(data); } let pathName = window.location.pathname; diff --git a/front/src/common/service/user.ts b/front/src/common/service/user.ts index 8ba92a0..0f8067e 100644 --- a/front/src/common/service/user.ts +++ b/front/src/common/service/user.ts @@ -146,8 +146,6 @@ export class UserService { if(rememberMe === true) { self.storageService.set(self.cookiesRememberMe, rememberMe?"true":"false"); } - // transfer the session token property - self.sessionService.setToken(token); if (isNullOrUndefined(environment.tokenStoredInPermanentStorage) || environment.tokenStoredInPermanentStorage !== true) { self.storageService.setSession(self.cookiesToken, token); } else { @@ -182,7 +180,8 @@ export class UserService { userAdmin: response.data.admin, userBlocked: response.data.blocked, userRemoved: response.data.removed, - userAvatar: response.data.avatar + userAvatar: response.data.avatar, + tokenJwt: token, }); resolve(true); }).catch((error:any) => { diff --git a/front/src/environments/environment.ts b/front/src/environments/environment.ts index ed34bb0..56a4787 100644 --- a/front/src/environments/environment.ts +++ b/front/src/environments/environment.ts @@ -55,5 +55,5 @@ const environment_hybrid = { }; -export const environment = environment_local; +export const environment = environment_back_prod;