Ali Farhoudi
Ali Farhoudi

Reputation: 6020

How to refresh personal access token programmatically in Laravel?

I have used createToken method on User model to create personal access token. Now I want to refresh that token in code without http request to oauth/token/refresh. How could I do that?

Upvotes: 4

Views: 5204

Answers (1)

user320487
user320487

Reputation:

How often are you trying to refresh personal access tokens? You should just recreate one, if/when needed. They are by default long lived so the expiry is quite long, one year if I recall correctly.

Personal access tokens are always long-lived. Their lifetime is not modified when using the tokensExpireIn or refreshTokensExpireIn methods.

Upvotes: 5

Related Questions