Skip to content

Commit

Permalink
fix logout behavior on non-root deployments (gh-pages)
Browse files Browse the repository at this point in the history
  • Loading branch information
jlcvp committed Sep 8, 2024
1 parent d0d9dfd commit caca1f8
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/app/home/home.page.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Component, HostListener, OnInit, ViewChild } from '@angular/core';
import { AuthenticationService } from '../services/authentication.service';
import { AlertController, IonModal, LoadingController, ToastController } from '@ionic/angular';
import { AlertController, IonModal, LoadingController, NavController, ToastController } from '@ionic/angular';
import { firstValueFrom, Observable } from 'rxjs';
import { Account2FA } from '../models/account2FA.model';
import { Account2faService } from '../services/accounts/account2fa.service';
Expand Down Expand Up @@ -77,6 +77,7 @@ export class HomePage implements OnInit {
private logoService: LogoService,
private storageService: LocalStorageService,
private translateService: TranslateService,
private navCtrl: NavController,
formBuilder: FormBuilder
) {
this.validations_form = formBuilder.group({
Expand Down Expand Up @@ -160,7 +161,9 @@ export class HomePage implements OnInit {
await this.authService.logout()
//reload window
await loading.dismiss()
window.location.href = '/'
await this.navCtrl.navigateRoot('/').then(() => {
window.location.reload()
})
}

selectAccount(account: any) {
Expand Down

0 comments on commit caca1f8

Please sign in to comment.