Skip to content

Commit

Permalink
#9 feat: create sanctum token and store it on session on user login
Browse files Browse the repository at this point in the history
  • Loading branch information
geeksesi committed Apr 7, 2023
1 parent 0984f00 commit 5eb8fca
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app/Http/Controllers/Auth/SocialiteController.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ public function callback(SocialiteProvider $provider): \Symfony\Component\HttpFo
]);

Auth::login($user);

$token = $user->createToken('pal', $user->tokenAbilities())->plainTextToken;
request()->session()->put('pal_token', $token);
return to_route('dashboard.index');
}
}

0 comments on commit 5eb8fca

Please sign in to comment.