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
And call the method `checkAuth()` from your `app.component.ts`. The method `checkAuth()` is needed to process the redirect from your secure token server and set the correct states. This method must be used to ensure the correct functioning of the library.
112
+
And call the method `checkAuth()` from your `app.component.ts`. The method `checkAuth()` is needed to process the redirect from your Security Token Service and set the correct states. This method must be used to ensure the correct functioning of the library.
Copy file name to clipboardExpand all lines: docs/site/angular-auth-oidc-client/docs/documentation/auto-login.md
+8-9Lines changed: 8 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,20 +5,20 @@ sidebar_position: 8
5
5
6
6
# Auto Login
7
7
8
-
If you want to have your app being redirected to the secure token server automatically without the user clicking any login button only by accessing a specific route, you can use the `AutoLoginPartialRoutesGuard` or the `AutoLoginAllRoutesGuard` provided by the lib. In case you are using multiple configs the guard currently uses the first config fix to perform a login! The guard handles `canActivate` and `canLoad` for you. It also saves the route you wanted to visit before the login and redirects you to that route after the successful login.
8
+
If you want to have your app being redirected to the Security Token Service automatically without the user clicking any login button only by accessing a specific route, you can use the `AutoLoginPartialRoutesGuard` or the `AutoLoginAllRoutesGuard` provided by the lib. In case you are using multiple configs the guard currently uses the first config fix to perform a login! The guard handles `canActivate` and `canLoad` for you. It also saves the route you wanted to visit before the login and redirects you to that route after the successful login.
9
9
10
-
Here are two use cases to distinguish:
10
+
Here are two use cases to distinguish: with and without a guarded default route.
11
11
12
12
### Auto Login when default route is not guarded
13
13
14
14
You have this case when you have some routes in your configuration publicly accessible and some routes should be protected by a login. The login should start when the user enters the route.
In this case the `/home` and the `/unauthorized` are not protected and accessible without a login.
35
-
36
-
Please make sure to call `checkAuth()` like normal in your `app.component.ts`
34
+
In this case the `/home` and `/unauthorized` routes are not protected and hence are accessible without a login.
35
+
Please make sure to call `checkAuth()` like normal in your `app.component.ts`.
37
36
38
37
```ts
39
38
exportclassAppComponentimplementsOnInit {
@@ -49,7 +48,7 @@ export class AppComponent implements OnInit {
49
48
50
49
### Auto Login when all routes are guarded
51
50
52
-
If all your routes are guarded please use the `AutoLoginAllRoutesGuard` instead of the `AutoLoginPartialRoutesGuard`. This guard ensures that `checkAuth` is being called for you and you do not have to call it in your `app.component.ts` then.
51
+
If all your routes are guarded please use the `AutoLoginAllRoutesGuard` instead of the `AutoLoginPartialRoutesGuard`. This guard ensures that `checkAuth()` is being called for you and you do not have to call it in your `app.component.ts` then.
0 commit comments