Added redirect after user credentials change

This commit is contained in:
2024-06-01 13:41:26 +02:00
parent 77202de315
commit 4977dbe98a
3 changed files with 14 additions and 5 deletions

View File

@@ -44,9 +44,10 @@ export class AdminuiComponent {
async init() {
this.username = await firstValueFrom(this.authStore.username$);
await this.verifyToken();
setInterval(() => {
this.verifyToken();
}, 1000);
}, 5000);
}
async verifyToken() {
@@ -81,6 +82,12 @@ export class AdminuiComponent {
this.edit_user_modal?.nativeElement.showModal();
}
logout() {
this.authStore.setToken("");
this.authStore.setUsername("");
this.router.navigate(['/login']);
}
async fetchFileUploads() {
try {
const response = await axios({