Logging out now properly redirects to login page
Some checks reported errors
continuous-integration/drone/push Build was killed
continuous-integration/drone Build is passing

This commit is contained in:
Garrett Mills 2021-03-16 23:53:56 -05:00
parent 2284c84897
commit 7be3bf5259
Signed by: garrettmills
GPG Key ID: D2BF5FBA8298F246
5 changed files with 12 additions and 6 deletions

View File

@ -697,7 +697,9 @@ export class AppComponent implements OnInit {
return;
}
this.initializeApp();
this.initializeApp().then(() => {
this.router.navigate(['/login']);
});
});
}

View File

@ -8,13 +8,13 @@ import {Router} from '@angular/router';
templateUrl: 'home.page.html',
styleUrls: ['home.page.scss'],
})
export class HomePage implements OnInit {
export class HomePage {
constructor(
public readonly api: ApiService,
public readonly router: Router,
) {}
ngOnInit() {
ionViewDidEnter() {
if ( !this.api.isAuthenticated || this.api.isPublicUser ) {
if ( isDebug() ) {
debug('Forcing authentication...');

View File

@ -23,6 +23,7 @@
[(ngModel)]="username"
[disabled]="step !== 'username'"
placeholder="Username"
(keyup.enter)="advance()"
></ion-input>
</ion-item>
<ion-item *ngIf="step === 'password'" style="padding-top: 10px;">
@ -31,6 +32,7 @@
[(ngModel)]="password"
placeholder="Password"
type="password"
(keyup.enter)="advance()"
></ion-input>
</ion-item>
<ion-item *ngIf="step === 'create-account'" style="padding-top: 10px;">
@ -53,6 +55,7 @@
[(ngModel)]="passwordConfirm"
placeholder="Confirm Password"
type="password"
(keyup.enter)="advance()"
></ion-input>
</ion-item>
<div class="buttons" style="text-align: right;">
@ -91,4 +94,4 @@
</ion-col>
</ion-row>
</ion-grid>
</div>
</div>

View File

@ -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 {AlertController, IonInput, LoadingController, ModalController, PopoverController} from '@ionic/angular';
import {EditorService} from '../../service/editor.service';

View File

@ -51,9 +51,10 @@ export class AuthService implements CanActivate {
await this.db.purge();
await this.api.endSession();
await this.router.navigate(['/login']);
await loader.dismiss();
this.nav.requestInitialization();
await this.router.navigate(['/login']);
}
}