You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Now the Guard itself.... I just don't know how to create an instance in the method... It complains on httpClient, then router.... so I've found a solution relying on injection
Here would be a tricky one.
Open your guard directory in a terminal window, and enter the following:
ng generate guard Access
In the app.module.ts file, in the bottom, paste the code:
Right after all imports and before @NgModule paste the piece:
export let AppInjector: Injector;
you would also need to import Injector
import { Injector, NgModule } from "@angular/core";
I leave my complete authentication.service.ts,
in login.component.ts insert in constructor
the login function in the same file has setSeesion method you need to place
Now the Guard itself.... I just don't know how to create an instance in the method... It complains on httpClient, then router.... so I've found a solution relying on injection
The text was updated successfully, but these errors were encountered: