Logging out now properly redirects to login page
This commit is contained in:
parent
2284c84897
commit
7be3bf5259
@ -697,7 +697,9 @@ export class AppComponent implements OnInit {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.initializeApp();
|
this.initializeApp().then(() => {
|
||||||
|
this.router.navigate(['/login']);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -8,13 +8,13 @@ import {Router} from '@angular/router';
|
|||||||
templateUrl: 'home.page.html',
|
templateUrl: 'home.page.html',
|
||||||
styleUrls: ['home.page.scss'],
|
styleUrls: ['home.page.scss'],
|
||||||
})
|
})
|
||||||
export class HomePage implements OnInit {
|
export class HomePage {
|
||||||
constructor(
|
constructor(
|
||||||
public readonly api: ApiService,
|
public readonly api: ApiService,
|
||||||
public readonly router: Router,
|
public readonly router: Router,
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
ngOnInit() {
|
ionViewDidEnter() {
|
||||||
if ( !this.api.isAuthenticated || this.api.isPublicUser ) {
|
if ( !this.api.isAuthenticated || this.api.isPublicUser ) {
|
||||||
if ( isDebug() ) {
|
if ( isDebug() ) {
|
||||||
debug('Forcing authentication...');
|
debug('Forcing authentication...');
|
||||||
|
@ -23,6 +23,7 @@
|
|||||||
[(ngModel)]="username"
|
[(ngModel)]="username"
|
||||||
[disabled]="step !== 'username'"
|
[disabled]="step !== 'username'"
|
||||||
placeholder="Username"
|
placeholder="Username"
|
||||||
|
(keyup.enter)="advance()"
|
||||||
></ion-input>
|
></ion-input>
|
||||||
</ion-item>
|
</ion-item>
|
||||||
<ion-item *ngIf="step === 'password'" style="padding-top: 10px;">
|
<ion-item *ngIf="step === 'password'" style="padding-top: 10px;">
|
||||||
@ -31,6 +32,7 @@
|
|||||||
[(ngModel)]="password"
|
[(ngModel)]="password"
|
||||||
placeholder="Password"
|
placeholder="Password"
|
||||||
type="password"
|
type="password"
|
||||||
|
(keyup.enter)="advance()"
|
||||||
></ion-input>
|
></ion-input>
|
||||||
</ion-item>
|
</ion-item>
|
||||||
<ion-item *ngIf="step === 'create-account'" style="padding-top: 10px;">
|
<ion-item *ngIf="step === 'create-account'" style="padding-top: 10px;">
|
||||||
@ -53,6 +55,7 @@
|
|||||||
[(ngModel)]="passwordConfirm"
|
[(ngModel)]="passwordConfirm"
|
||||||
placeholder="Confirm Password"
|
placeholder="Confirm Password"
|
||||||
type="password"
|
type="password"
|
||||||
|
(keyup.enter)="advance()"
|
||||||
></ion-input>
|
></ion-input>
|
||||||
</ion-item>
|
</ion-item>
|
||||||
<div class="buttons" style="text-align: right;">
|
<div class="buttons" style="text-align: right;">
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import {Component, ElementRef, OnInit, ViewChild} from '@angular/core';
|
import {Component, ElementRef, HostListener, OnInit, ViewChild} from '@angular/core';
|
||||||
import {ActivatedRoute, Router} from '@angular/router';
|
import {ActivatedRoute, Router} from '@angular/router';
|
||||||
import {AlertController, IonInput, LoadingController, ModalController, PopoverController} from '@ionic/angular';
|
import {AlertController, IonInput, LoadingController, ModalController, PopoverController} from '@ionic/angular';
|
||||||
import {EditorService} from '../../service/editor.service';
|
import {EditorService} from '../../service/editor.service';
|
||||||
|
@ -51,9 +51,10 @@ export class AuthService implements CanActivate {
|
|||||||
|
|
||||||
await this.db.purge();
|
await this.db.purge();
|
||||||
await this.api.endSession();
|
await this.api.endSession();
|
||||||
await this.router.navigate(['/login']);
|
|
||||||
|
|
||||||
await loader.dismiss();
|
await loader.dismiss();
|
||||||
this.nav.requestInitialization();
|
this.nav.requestInitialization();
|
||||||
|
|
||||||
|
await this.router.navigate(['/login']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user