Skip to content
This repository was archived by the owner on Jan 20, 2024. It is now read-only.
This repository was archived by the owner on Jan 20, 2024. It is now read-only.

Ability to save and restore token #38

@kirill-konshin

Description

@kirill-konshin

Currently it's not possible to get token data, save it in persistent storage between application runs and then recover the token:

function ClientOAuth2Token (client, data) {
  this.client = client
  this.data = data
  this.tokenType = data.token_type && data.token_type.toLowerCase()
  this.accessToken = data.access_token
  this.refreshToken = data.refresh_token

  this.expiresIn(data.expires_in)
}

Constructor does not allow to pass data.expires.

Plus, this class does not handle expiration of refresh token.

Also, sign method should probably throw an error if user tries to sign with expired token.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions