Last active
August 29, 2015 14:07
-
-
Save mgonto/0f083a43f91e0ca024b9 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var request = new Request(); | |
request.url = bla | |
request.header = { | |
// If he used session | |
Authorization: 'Bearer ' + A0Session.store.idToken | |
} | |
request.make(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (A0Session.isTokenExpired()) { | |
A0Session.refreshTokens(function(token, profile) { | |
A0Session.storeInfo(token, profile); | |
}); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var login = new LoginController(); | |
login.onAuthentication(function(profile, tokenObj) { | |
// Do something with Profile and Token | |
// YOu can save it using the SDK | |
A0Session.storeInfo(profile, tokenObj); | |
}); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment