Skip to content

Commit 64bc9c1

Browse files
authored
Merge pull request #1235 from fmalcher/docs1808
docs: clean up documentation
2 parents b0af92b + 024de48 commit 64bc9c1

30 files changed

+402
-392
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ import { AuthModule, LogLevel } from 'angular-auth-oidc-client';
109109
export class AppModule {}
110110
```
111111

112-
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.
113113

114114
```ts
115115
import { Component, OnInit } from '@angular/core';

docs/site/angular-auth-oidc-client/docs/documentation/auto-login.md

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,20 @@ sidebar_position: 8
55

66
# Auto Login
77

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.
99

10-
Here are two use cases to distinguish:
10+
Here are two use cases to distinguish: with and without a guarded default route.
1111

1212
### Auto Login when default route is not guarded
1313

1414
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.
1515

16-
For example
16+
#### Example
1717

1818
```ts
1919
import { AutoLoginPartialRoutesGuard } from 'angular-auth-oidc-client';
2020

21-
const appRoutes: Routes = [
21+
const routes: Routes = [
2222
{ path: '', pathMatch: 'full', redirectTo: 'home' },
2323
{ path: 'home', component: HomeComponent },
2424
{ path: 'protected', component: ProtectedComponent, canActivate: [AutoLoginPartialRoutesGuard] },
@@ -31,9 +31,8 @@ const appRoutes: Routes = [
3131
];
3232
```
3333

34-
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`.
3736

3837
```ts
3938
export class AppComponent implements OnInit {
@@ -49,7 +48,7 @@ export class AppComponent implements OnInit {
4948

5049
### Auto Login when all routes are guarded
5150

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.
5352

5453
```ts
5554
export class AppComponent implements OnInit {
@@ -78,4 +77,4 @@ const appRoutes: Routes = [
7877
];
7978
```
8079

81-
[src code](../projects/sample-code-flow-auto-login)
80+
[Source Code](../projects/sample-code-flow-auto-login)

0 commit comments

Comments
 (0)