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
*`PROTECTED_FALLBACK_PAGE_URI` - main protected page to be redirected to, in case if user will reach public route, that is protected
115
-
by `publicGuard` and will be authenticated
116
-
117
-
*`PUBLIC_FALLBACK_PAGE_URI` - main public page to be redirected to, in case if user will reach protected route, that is protected
118
-
by `protectedGuard` and won't be authenticated
119
-
120
-
*`AUTH_SERVICE` - Authentication service token providers
121
-
122
-
3. Provide your `AuthenticationModule` in your `AppModule`
20
+
1. Import `NgxAuthService` interface to implement it with your custom Authentication service, e.g.:
21
+
2. Specify functions `ngxPublicGuard` for public routes and `ngxProtectedGuard` for protected respectively, e.g.:
22
+
3. Use `provideNgxAuthProviders` to provide `NgxAuthService` implementation and `protectedRedirectUri`, `publicRedirectUri` redirect uris
123
23
124
24
### Customizing authentication headers
125
-
126
-
By default, requests are intercepted and a `{ Authorization: 'Bearer ${token}'}` header is injected. To customize this behavior, implement the `getHeaders` method on your `AuthenticationService`
25
+
By default, requests are intercepted and a `{ Authorization: 'Bearer ${token}'}` header is injected. To customize this behavior, implement the `getHeaders` method on your `NgxAuthService`
127
26
128
27
### After login redirect to the interrupted URL
28
+
The `NgxAuthService` has an optional method `setInterruptedUrl` which saves the URL that was requested before the user is redirected to the login page. This property can be used in order to redirect the user to the originally requested page after he logs in.
129
29
130
-
The `AuthService` has an optional method `setInterruptedUrl` which saves the URL that was requested before the user is redirected to the login page. This property can be used in order to redirect the user to the originally requested page after he logs in. E.g. in your `login.component.ts` (check also `AuthService` implementation above):
0 commit comments