Feature: Adding recipe templates to print recipes.
Feautre: Recipe export to xlsx Chore: Python 11 style type annotations Chore: Moved to sqlalchemy 2.0 Chore: Minimum python is 3.11 Fix: Fix nullability of a lot of fields in the database.
This commit is contained in:
1 parent
d2d26ab1ae
commit
22cac61761
344 files changed
+3247
-2370
No files matched your search
@@ -1,12 +1,12 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Router, CanActivate, ActivatedRouteSnapshot, RouterStateSnapshot } from '@angular/router';
|
||||
import { Router, ActivatedRouteSnapshot, RouterStateSnapshot } from '@angular/router';
|
||||
|
||||
import { ToasterService } from '../core/toaster.service';
|
||||
|
||||
import { AuthService } from './auth.service';
|
||||
|
||||
@Injectable({ providedIn: 'root' })
|
||||
export class AuthGuard implements CanActivate {
|
||||
export class AuthGuard {
|
||||
constructor(
|
||||
private router: Router,
|
||||
private authService: AuthService,
|
||||
@@ -16,9 +16,9 @@ export class AuthGuard implements CanActivate {
|
||||
canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot) {
|
||||
const { user } = this.authService;
|
||||
const permission =
|
||||
route.data.permission === undefined
|
||||
? route.data.permission
|
||||
: route.data.permission.replace(/ /g, '-').toLowerCase();
|
||||
route.data['permission'] === undefined
|
||||
? route.data['permission']
|
||||
: route.data['permission'].replace(/ /g, '-').toLowerCase();
|
||||
if (!user) {
|
||||
// not logged in so redirect to login page with the return url
|
||||
this.router.navigate(['/login'], { queryParams: { returnUrl: state.url } });
|
||||
|
||||
Reference in new issue
Block a user