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
Copy file name to clipboardExpand all lines: README.md
+40-1
Original file line number
Diff line number
Diff line change
@@ -222,7 +222,46 @@ The following snippet contains the template for the login page:
222
222
223
223
If you don't want to display a login form that tells the user that they are redirected to the identity server, you can use the convenience function ``this.oauthService.loadDiscoveryDocumentAndLogin();`` instead of ``this.oauthService.loadDiscoveryDocumentAndTryLogin();`` when setting up the library.
224
224
225
-
This directly redirects the user to the identity server if there are no valid tokens.
225
+
This directly redirects the user to the identity server if there are no valid tokens. Ensure you have your `issuer` set to your discovery document endpoint!
226
+
227
+
228
+
#### Manually skipping
229
+
230
+
This is sort of what ``this.oauthService.loadDiscoveryDocumentAndLogin();`` is doing under the hood. But this gives you a fair bit more control
231
+
232
+
```TypeScript
233
+
this.oauthService
234
+
.loadDiscoveryDocumentAndTryLogin(/* { your LoginOptions }*/) // checks to see if the current url contains id token and access token
235
+
.(hasReceivedTokens=> {
236
+
// this would have stored all the tokens needed
237
+
if (hasReceivedTokens) {
238
+
// carry on with your app
239
+
returnPromise.resolve();
240
+
241
+
/* if you wish to do something when the user receives tokens from the identity server,
242
+
* use the event stream or the `onTokenReceived` callback in LoginOptions.
0 commit comments