Skip to content

Commit d987be2

Browse files
authored
chore: clarify use of global script version (#357)
closes #355
1 parent 1fbb00c commit d987be2

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)