1
0
mirror of https://github.com/bpatrik/pigallery2.git synced 2024-12-23 01:27:14 +02:00

Fixing shared login bug of needs refresh after entering the password.

fixes #591
This commit is contained in:
Patrik J. Braun 2023-01-13 11:40:50 +01:00
parent 65ce042278
commit 66d663b8bc
3 changed files with 10 additions and 4 deletions

View File

@ -1,6 +1,6 @@
import {Injectable} from '@angular/core';
import {Router} from '@angular/router';
import {IsActiveMatchOptions, Router} from '@angular/router';
import {ShareService} from '../ui/gallery/share.service';
import {Config} from '../../../common/config/public/Config';
import {NavigationLinkTypes} from '../../../common/config/public/ClientConfig';
@ -12,8 +12,10 @@ export class NavigationService {
public isLoginPage(): boolean {
return (
this.router.isActive('login', true) ||
this.router.isActive('shareLogin', true)
this.router.isActive('login',
{paths: 'exact', queryParams: 'exact', fragment: 'ignored', matrixParams: 'ignored'} as IsActiveMatchOptions) ||
this.router.isActive('shareLogin',
{paths: 'exact', queryParams: 'ignored', fragment: 'ignored', matrixParams: 'ignored'} as IsActiveMatchOptions)
);
}

View File

@ -28,7 +28,7 @@
<div class="col-sm-12 controls d-grid gap-2">
<button class="btn btn-primary btn-lg"
[disabled]="!LoginForm.form.valid"
[disabled]="!LoginForm.form.valid || inProgress"
type="submit"
name="action" i18n>Enter
</button>

View File

@ -12,6 +12,7 @@ import {NavigationService} from '../../model/navigation.service';
export class ShareLoginComponent implements OnInit {
password: string;
loginError = false;
inProgress = false;
title: string;
constructor(
@ -30,6 +31,7 @@ export class ShareLoginComponent implements OnInit {
async onLogin(): Promise<void> {
this.loginError = false;
this.inProgress = true;
try {
await this.authService.shareLogin(this.password);
} catch (error) {
@ -40,6 +42,8 @@ export class ShareLoginComponent implements OnInit {
this.loginError = true;
}
}
this.inProgress = false;
}
}