Skip to content

Commit

Permalink
feat: store saveToken
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeff Tian committed Nov 12, 2019
1 parent fb2c795 commit d48dc45
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,21 +113,18 @@ export default class CitiOAuth {
}
: getToken

if (
!saveToken &&
(process.env.NODE_ENV === 'production' || process.env.NODE_ENV === 'prod')
) {
if (!saveToken) {
this.logger.warn(
`Please don't save oauth token into memory under production!`
)
}

if (!saveToken) {
this.saveToken = (openid: string, token: object) => {
this.store[openid] = token

return Promise.resolve()
}
} else {
this.saveToken = saveToken
}

this.endpoint = 'https://sandbox.apihub.citi.com/gcb/api'
Expand Down

0 comments on commit d48dc45

Please sign in to comment.