Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
garronej committed Oct 24, 2023
1 parent 4ca674d commit 9a6aea2
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,14 +74,16 @@ import { createOidc, decodeJwt } from "oidc-spa";

if (oidc.isUserLoggedIn) {
// This return a promise that never resolve. Your user will be redirected to the identity server.
// doesCurrentHrefRequiresAuth determines the behavior when a user gives up on loggin in and navigate back.
// We don't want to send him back to a authenticated route.
// If you are calling login because the user clicked
// on a 'login' button you should set doesCurrentHrefRequiresAuth to false.
// When you are calling login because your user navigated to a path that require authentication
// you should set doesCurrentHrefRequiresAuth to true
oidc.login({ doesCurrentHrefRequiresAuth: false });
} else {
const {
// The accessToken is what you'll use a a Bearer token to authenticate to your APIs
// The accessToken is what you'll use as a Bearer token to authenticate to your APIs
accessToken,
// You can parse the idToken as a JWT to get some information about the user.
idToken
Expand Down

0 comments on commit 9a6aea2

Please sign in to comment.