Skip to content

Commit

Permalink
feat(methods): return session object
Browse files Browse the repository at this point in the history
  • Loading branch information
talissonf committed Aug 22, 2019
1 parent fe09e14 commit 7fbc42e
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/methods/get-session.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// TODO
export default (self, callback) => {
self.ecomClient

.passport({
url: `${self.reqId}/token.json`
})

.then(({ data }) => {
self.setSession(data)
if (typeof callback === 'function') {
callback(data)
}
})

.catch(err => console.error('Passport API request failed', err))
}

0 comments on commit 7fbc42e

Please sign in to comment.