Skip to content

Commit c7b9bd0

Browse files
authored
clarify use of global script version
1 parent 01395a0 commit c7b9bd0

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

README.md

+4-1
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ You can use this global object like this:
5959
netlifyIdentity.open();
6060

6161
// Get the current user:
62+
// Available after on('init') is invoked
6263
const user = netlifyIdentity.currentUser();
6364

6465
// Bind to events
@@ -78,7 +79,9 @@ netlifyIdentity.close();
7879

7980
// Log out the user
8081
netlifyIdentity.logout();
81-
// refresh the user's JWT
82+
83+
// Refresh the user's JWT
84+
// Call in on('login') handler to ensure token refreshed after it expires (1hr)
8285
// Note: this method returns a promise.
8386
netlifyIdentity.refresh().then((jwt)=>console.log(jwt))
8487

0 commit comments

Comments
 (0)