[Simple gui increase and auto-login-corection

This commit is contained in:
Edouard DUPIN 2022-06-08 00:04:54 +02:00
parent 37550779aa
commit 8990249bb8
7 changed files with 35 additions and 12 deletions

View File

@ -7,4 +7,10 @@
--> -->
<div class="main-content"> <div class="main-content">
<router-outlet *ngIf="autoConnectedDone"></router-outlet> <router-outlet *ngIf="autoConnectedDone"></router-outlet>
<div class="generic-page" *ngIf="!isConnected">
<div class="fill-all colomn_mutiple">
<b style="color:red;">You Must be connected to access @Karideo...</b>
<div class="clear"></div>
</div>
</div>
</div> </div>

View File

@ -64,7 +64,7 @@
</button> </button>
</div> </div>
<button class="item" <button class="item"
*ngIf="login === null" *ngIf="!login"
style="float:right;" style="float:right;"
(click)="onSignUp($event)" (click)="onSignUp($event)"
(auxclick)="onSignUp($event)"> (auxclick)="onSignUp($event)">
@ -76,7 +76,7 @@
</div> </div>
</button> </button>
<button class="item" <button class="item"
*ngIf="login === null" *ngIf="!login"
style="float:right;" style="float:right;"
(click)="onSignIn($event)" (click)="onSignIn($event)"
(auxclick)="onSignIn($event)"> (auxclick)="onSignIn($event)">
@ -88,7 +88,7 @@
</div> </div>
</button> </button>
<button class="item" <button class="item"
*ngIf="login !== null" *ngIf="login"
style="float:right; height:56px;" style="float:right; height:56px;"
(click)="onAvatar()"> (click)="onAvatar()">
<img class="avatar" src="{{avatar}}"/> <img class="avatar" src="{{avatar}}"/>

View File

@ -13,8 +13,8 @@ import { UserService, SessionService, SSOService, ArianeService } from '../../se
styleUrls: [ './top-menu.less' ] styleUrls: [ './top-menu.less' ]
}) })
export class TopMenuComponent implements OnInit { export class TopMenuComponent implements OnInit {
public login: string = null;// Session.getLogin(); public login: string;// Session.getLogin();
public avatar: string = null;// Session.getAvatar(); public avatar: string;// Session.getAvatar();
public displayUserMenu: boolean = false; public displayUserMenu: boolean = false;
public displayEditMenu: boolean = false; public displayEditMenu: boolean = false;
@ -48,8 +48,8 @@ export class TopMenuComponent implements OnInit {
this.sessionService.change.subscribe((isConnected) => { this.sessionService.change.subscribe((isConnected) => {
console.log(`TOP-MENU: receive event from session ...${isConnected}`); console.log(`TOP-MENU: receive event from session ...${isConnected}`);
if(isConnected === false) { if(isConnected === false) {
self.login = null; self.login = undefined;
self.avatar = null; self.avatar = undefined;
self.displayUserMenu = false; self.displayUserMenu = false;
} else { } else {
self.updateIsJusteLogged(); self.updateIsJusteLogged();

View File

@ -1,6 +1,6 @@
<div class="generic-page"> <div class="generic-page">
<div class="title"> <div class="title">
Karauth (SSO identity manager) Help area. Karideo Help
</div> </div>
<div class="fill-all colomn_mutiple"> <div class="fill-all colomn_mutiple">
Help Help

View File

@ -1,6 +1,6 @@
<div class="generic-page"> <div class="generic-page">
<div class="title"> <div class="title">
Karauth (SSO identity manager) Karideo Settings
</div> </div>
<div class="fill-all colomn_mutiple"> <div class="fill-all colomn_mutiple">
Global settings. Global settings.

View File

@ -1,9 +1,17 @@
.title { .title {
width: 90%; //background-color: green;
margin: 0 auto; font-size: 45px;
font-size: 50px; font-weight: bold;
line-height: 60px;
width:100%;
text-align: center; text-align: center;
vertical-align: middle;
margin: 10px 0 10px 0;
text-shadow: 1px 1px 2px white, 0 0 1em white, 0 0 0.2em white;
text-transform: uppercase;
font-family: "Roboto","Helvetica","Arial",sans-serif;
} }
.request_raw_table { .request_raw_table {

View File

@ -74,6 +74,7 @@ export class UserService {
console.error(`Retreive exp data=${new Date(parsedData.exp*1000).toISOString()} < ${new Date().toISOString()}`); console.error(`Retreive exp data=${new Date(parsedData.exp*1000).toISOString()} < ${new Date().toISOString()}`);
const expireIn = new Date(parsedData.exp*1000); const expireIn = new Date(parsedData.exp*1000);
const nowTime = new Date(); const nowTime = new Date();
// TODO: set a marging of 2 hours...
return expireIn > nowTime; return expireIn > nowTime;
} }
/** /**
@ -98,9 +99,17 @@ export class UserService {
let token = self.storageService.getSession(self.cookiesToken); let token = self.storageService.getSession(self.cookiesToken);
// TODO: check validity of th eToken: // TODO: check validity of th eToken:
if (self.isTokenUpToDate(token)) { if (self.isTokenUpToDate(token)) {
// remove in case of fail !!!
this.storageService.removeSession(this.cookiesToken);
self.startSession(token, rememberMe).then(() => { self.startSession(token, rememberMe).then(() => {
resolve(); resolve();
}).catch(() => { }).catch(() => {
// jump in the sign-in page (automatically of request remember-me)
if(rememberMe) {
// just to the sso !!!
self.ssoService.requestSignIn();
reject();
}
resolve(); resolve();
}); });
} else { } else {