Skip to content

Commit 5c49e85

Browse files
committed
Update add-aad-auth.md
Added missing step to pass the login/logout methods to the components.
1 parent 3d8583f commit 5c49e85

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

tutorial/add-aad-auth.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,24 @@ logout() {
8282
}
8383
```
8484

85+
Now that the `login` and `logout` methods are implemented, update the `NavBar` and `Welcome` elements in the `render` method of the `App` class. Replace the existing `NavBar` element with the following.
86+
87+
```JSX
88+
<NavBar
89+
isAuthenticated={this.state.isAuthenticated}
90+
authButtonMethod={this.state.isAuthenticated ? this.logout.bind(this) : this.login.bind(this)}
91+
user={this.state.user}/>
92+
```
93+
94+
Replace the existing `Welcome` element with the following.
95+
96+
```JSX
97+
<Welcome {...props}
98+
isAuthenticated={this.state.isAuthenticated}
99+
user={this.state.user}
100+
authButtonMethod={this.login.bind(this)} />
101+
```
102+
85103
Finally, implement the `getUserProfile` function. Add the following function to the `App` class.
86104

87105
```js

0 commit comments

Comments
 (0)