CaCu Indicadores as the old page: its cards and words, the route, cytology and biopsy donuts, results by clinical scenario, confirmation rates; the page test compares with the capture; the guard injects before it waits
This commit is contained in:
@@ -67,10 +67,9 @@ export class Auth {
|
||||
/** Pages show only to someone signed in; the others go to the sign-in page and come back. */
|
||||
export const signedIn: CanActivateFn = async (_route, state) => {
|
||||
const auth = inject(Auth);
|
||||
const router = inject(Router); // before any await: inject works only in the guard's first turn
|
||||
const user = auth.user() === undefined ? await auth.load() : auth.user();
|
||||
return user
|
||||
? true
|
||||
: inject(Router).createUrlTree(['/login'], { queryParams: { next: state.url } });
|
||||
return user ? true : router.createUrlTree(['/login'], { queryParams: { next: state.url } });
|
||||
};
|
||||
|
||||
/** A domain's pages show only to whom may see it. */
|
||||
|
||||
Reference in New Issue
Block a user