Closed FatefulNur closed 5 months ago
why it's deleting all the token it should delete the transit token instead of all.
@RahulDey12 thanks for your advice. Could you tell what's the regard to delete only the transient token?
It mean that we are logging out.
May be the idea wasn't relevant with api tokens.
This PR introduces new
regenerateToken
method to theHasApiTokens
traits in Laravel Sanctum. This method allows users to regenerate a new personal access token while revoking the existing one.Changes:
regenerateToken
method to theHasApiTokens
traits and contract.Use-Case
For scenarios requiring frequent rotation of access tokens to mitigate security risks, the addition of a
regenerateToken
method to Laravel Sanctum can greatly simplify token management without manually creating it into our own model.Testing:
A unit test have been added to ensure the proper functionality of the
regenerateToken
method.