Suppose I have such a theoretical situation that I need to withdraw all the access tokens of a specific user, for some of his manipulations.
1 answer
Reading stackoverflow English and google wool without finding the full answer, I came up with this option.
\DB::table('oauth_access_tokens') ->where('user_id', \Auth::user()->id) ->where('revoked', '<>', 1) ->update(['revoked' => 1]); There were options to do something similar using \ Auth :: user () -> tokens, but there were many queries to the database, so I tend to think that the chosen option is more economical.
|