mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 13:02:56 +00:00
save
This commit is contained in:
@@ -29,8 +29,8 @@ export class AuthGuard implements CanActivate {
|
|||||||
this.router.navigate(['/']);
|
this.router.navigate(['/']);
|
||||||
return false
|
return false
|
||||||
} else {
|
} else {
|
||||||
this.authService.loginChat(SessionStore.user)
|
this.authService.loginChat();
|
||||||
return true
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -118,7 +118,7 @@ export class InactivityPage implements OnInit {
|
|||||||
// if current attemp is equal to the current user
|
// if current attemp is equal to the current user
|
||||||
if (attempt.UserId == SessionStore.user.UserId) {
|
if (attempt.UserId == SessionStore.user.UserId) {
|
||||||
await this.authService.SetSession(attempt, this.userattempt);
|
await this.authService.SetSession(attempt, this.userattempt);
|
||||||
this.authService.loginChat(this.userattempt);
|
this.authService.loginChat();
|
||||||
this.getToken();
|
this.getToken();
|
||||||
SessionStore.setInativity(true)
|
SessionStore.setInativity(true)
|
||||||
|
|
||||||
|
|||||||
@@ -102,7 +102,7 @@ export class LoginPage implements OnInit {
|
|||||||
if (attempt) {
|
if (attempt) {
|
||||||
if (attempt.UserId == SessionStore.user.UserId) {
|
if (attempt.UserId == SessionStore.user.UserId) {
|
||||||
await this.authService.SetSession(attempt, this.userattempt);
|
await this.authService.SetSession(attempt, this.userattempt);
|
||||||
await this.authService.loginChat(this.userattempt);
|
await this.authService.loginChat();
|
||||||
this.getToken();
|
this.getToken();
|
||||||
SessionStore.setInativity(true);
|
SessionStore.setInativity(true);
|
||||||
|
|
||||||
@@ -116,7 +116,7 @@ export class LoginPage implements OnInit {
|
|||||||
await this.authService.SetSession(attempt, this.userattempt);
|
await this.authService.SetSession(attempt, this.userattempt);
|
||||||
|
|
||||||
this.changeProfileService.run()
|
this.changeProfileService.run()
|
||||||
await this.authService.loginChat(this.userattempt);
|
await this.authService.loginChat();
|
||||||
this.getToken();
|
this.getToken();
|
||||||
this.router.navigateByUrl('/pin', { replaceUrl: true });
|
this.router.navigateByUrl('/pin', { replaceUrl: true });
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -109,7 +109,7 @@ export class AuthService {
|
|||||||
|
|
||||||
//Login to rocketChat server2
|
//Login to rocketChat server2
|
||||||
//user: UserForm
|
//user: UserForm
|
||||||
async loginChat(user: any) {
|
async loginChat() {
|
||||||
|
|
||||||
const expirationMinutes = 60;
|
const expirationMinutes = 60;
|
||||||
let date = new Date().getTime();
|
let date = new Date().getTime();
|
||||||
@@ -136,12 +136,12 @@ export class AuthService {
|
|||||||
this.presentAlert('Network error');
|
this.presentAlert('Network error');
|
||||||
}
|
}
|
||||||
|
|
||||||
this.autoLoginChat(expirationDate.getTime() - date, user);
|
this.autoLoginChat(expirationDate.getTime() - date);
|
||||||
}
|
}
|
||||||
|
|
||||||
async autoLoginChat(expirationDate:number, user:any){
|
async autoLoginChat(expirationDate:number){
|
||||||
setTimeout(()=>{
|
setTimeout(()=>{
|
||||||
this.loginChat(user);
|
this.loginChat();
|
||||||
}, expirationDate)
|
}, expirationDate)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user