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
-`<your-organization-base-url>` with the Base URL you noted in Step 1 (e.g., `https://api.asgardeo.io/t/<your-organization-name>`)
87
87
-`<your-app-client-id>` with the Client ID from Step 1
88
88
89
-
## Step 4: Add Sign-in & Sign-out to Your App
89
+
## Step 5: Add Sign-in & Sign-out to Your App
90
90
91
91
Update your `App.tsx` to include sign-in and sign-out functionality:
92
92
@@ -110,7 +110,40 @@ function App() {
110
110
exportdefaultApp
111
111
```
112
112
113
-
## Step 6: Try Login
113
+
## Step 6: Display User Information
114
+
115
+
You can also display user information by using the `User` component & the `UserProfile` component:
116
+
117
+
```diff
118
+
import { User, UserProfile } from '@asgardeo/react'
119
+
import './App.css'
120
+
121
+
function App() {
122
+
return (
123
+
<>
124
+
<SignedIn>
125
+
+ <User>
126
+
+ {({ user }) => (
127
+
+ <div>
128
+
+ <h1>Welcome, {user.username}</h1>
129
+
+ <UserProfile />
130
+
+ </div>
131
+
+ )}
132
+
+ </User>
133
+
+ <UserProfile />
134
+
<SignOutButton />
135
+
</SignedIn>
136
+
<SignedOut>
137
+
<SignInButton />
138
+
</SignedOut>
139
+
</>
140
+
)
141
+
}
142
+
143
+
export default App
144
+
```
145
+
146
+
## Step 7: Try Login
114
147
115
148
Run your application and test the sign-in functionality. You should see a "Sign In" button when you're not signed in, and clicking it will redirect you to the Asgardeo sign-in page.
0 commit comments