Skip to content
This repository has been archived by the owner on Mar 22, 2022. It is now read-only.

Attempt to get token right away. #252

Merged
merged 2 commits into from
Aug 9, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/client/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ export default function(opts = {}) {
app.set('storage', getStorage(config.storage));
}

getJWT(config.tokenKey, config.cookie, this.get('storage')).then(token => {
app.set('token', token);
app.get('storage').setItem(config.tokenKey, token);
});

app.authenticate = function(options = {}) {
const storage = this.get('storage');
let getOptions = Promise.resolve(options);
Expand Down