This repository was archived by the owner on Dec 13, 2018. It is now read-only.

Description
From the AngularJS implementation:
// This access token getter attempts to refresh expired access tokens if needed, which is why it is async (promise)
$auth.getAccessToken()
.then(function(accessToken){
$http({
url: 'http://localhost:3000/api/subscription',
method: 'GET',
headers: {
Authorization: 'Bearer ' + accessToken
}
);
})
.catch(function(){
// Could not get access token, user is not logged in
});
If access token is expired, it will automatically try to get a new one with a refresh token.