Revert "Add navigation to current URL after login dialog completion"
This reverts commit 3da46c203b.
This commit is contained in:
parent
3da46c203b
commit
e697f7ca90
|
|
@ -7,7 +7,6 @@ import {JwtHelperService} from '@auth0/angular-jwt';
|
||||||
import {JwtClaims} from '@custom-types/jwt_interface'
|
import {JwtClaims} from '@custom-types/jwt_interface'
|
||||||
import {LoginDialogComponent} from '@shared-components/login/login.component';
|
import {LoginDialogComponent} from '@shared-components/login/login.component';
|
||||||
import {MatDialog} from '@angular/material/dialog';
|
import {MatDialog} from '@angular/material/dialog';
|
||||||
import {Router} from '@angular/router';
|
|
||||||
|
|
||||||
@Injectable({
|
@Injectable({
|
||||||
providedIn: 'root'
|
providedIn: 'root'
|
||||||
|
|
@ -25,8 +24,7 @@ export class AuthService {
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private loginService: LoginService,
|
private loginService: LoginService,
|
||||||
private snackBar: MatSnackBar,
|
private snackBar: MatSnackBar
|
||||||
private router: Router
|
|
||||||
) {
|
) {
|
||||||
// Check if user is already logged in on service initialization
|
// Check if user is already logged in on service initialization
|
||||||
this.checkAuthStatus();
|
this.checkAuthStatus();
|
||||||
|
|
@ -78,14 +76,11 @@ export class AuthService {
|
||||||
const jwt = this.getJwt();
|
const jwt = this.getJwt();
|
||||||
if (!jwt) {
|
if (!jwt) {
|
||||||
console.log("No JWT found");
|
console.log("No JWT found");
|
||||||
const currentUrl = this.router.url;
|
|
||||||
const dialogRef = this.dialog.open(LoginDialogComponent, {
|
const dialogRef = this.dialog.open(LoginDialogComponent, {
|
||||||
width: '400px',
|
width: '400px',
|
||||||
})
|
})
|
||||||
dialogRef.afterClosed().subscribe(result => {
|
dialogRef.afterClosed().subscribe(result => {
|
||||||
if (result) {
|
console.log(result);
|
||||||
this.router.navigateByUrl(currentUrl).then();
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user