release: @marketplaces/auth 0.1.0 (built from main)
This commit is contained in:
11
dist/telegram/admin-auth.guard.js
vendored
Normal file
11
dist/telegram/admin-auth.guard.js
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
import { inject } from '@angular/core';
|
||||
import { AdminAuthService } from './admin-auth.service';
|
||||
/** Guards `/admin/**`-style routes. Never shares state with the customer auth guard/service. */
|
||||
export const adminAuthGuard = () => {
|
||||
const adminAuth = inject(AdminAuthService);
|
||||
if (adminAuth.isAuthenticated()) {
|
||||
return true;
|
||||
}
|
||||
adminAuth.requestLogin();
|
||||
return false;
|
||||
};
|
||||
Reference in New Issue
Block a user