how to delete token related to SPA or Mobile in logout route?
i used sanctum with this
$user->currentAccessToken()->delete();
in the logout action but i got this error "Call to undefined method Laravel\Sanctum\TransientToken::delete()"
i know it relates to EnsureFrontendRequestsAreStateful middleware but i want to use SPA and mobile at the same time.
$user->tokens()->delete() work but it deletes all user tokens.
another question i have:
can i use sanctum access token as public key for third party authentication in our API system. i want to create token for user in the admin panel and with this token user can use API of our system.
it delete all tokens, i want to delete just current access token.
assume a user login with web browser or mobile app or try to use API as third party in this way all tokens deleted
Thanks but i tried earlier and it dosen't work, throw an error
{"message":"Call to undefined method Laravel\Sanctum\TransientToken::delete()","errors":null