Skip to content

Refresh token support? #34

Description

@AirplanegoBrr

It would be cool if when you set the auth token if you could also pass in the refresh token- like so:

kient.setAuthToken({ // This would still support arg1 as the authToken ofc-
auth: "auth token",
refresh: "refresh token",
expires: "expires date/seconds" // // Maybe the expireTime should be a date or just the seconds- or support for both!-
}); 
kient.setClient("client id", "client secret"); // allows refreshing of token

Then the module would auto-update the token when required- or if the request fails- it would then try to update the token

When a token is updated- a event should be fired- KIENT_TOKEN_UPDATE which should include the new token and refresh token- (to be saved in a file)- if the expireTime above can be a date, then the returned "expire time" should also be a date in the event data

If this sounds OK- I could try to make this a PR.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions