Example #1
0
 public function routes()
 {
     Route::get('auth/logout', function () {
         Auth::logout();
     });
     Route::get('/token/{token}', function ($token) {
         $usertoken = UserToken::where('token', $token)->firstOrFail();
         Auth::loginUsingId($usertoken->user_id);
         $usertoken->delete();
     });
     Route::get('/refresh', function () {
         return;
     });
 }
 public function token($token)
 {
     $usertoken = UserToken::where('token', $token)->firstOrFail();
     Auth::loginUsingId($usertoken->user_id);
     $usertoken->delete();
 }