[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">
<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>

View File

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

View File

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

View File

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

View File

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

View File

@ -1,9 +1,17 @@
.title {
width: 90%;
margin: 0 auto;
font-size: 50px;
//background-color: green;
font-size: 45px;
font-weight: bold;
line-height: 60px;
width:100%;
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 {

View File

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