Skip to content

Commit

Permalink
feat: send google auth token in cookie instead of search param
Browse files Browse the repository at this point in the history
  • Loading branch information
Finnick223 committed Dec 9, 2024
1 parent 9be59ab commit edf066b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions app/Http/Controllers/GoogleAuthController.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use App\Models\User;
use Exception;
use Illuminate\Cookie\Middleware\EncryptCookies;
use Illuminate\Support\Str;
use Laravel\Socialite\Facades\Socialite;
use Symfony\Component\HttpFoundation\Response;
Expand Down Expand Up @@ -35,8 +36,8 @@ public function handleGoogleCallback()

$frontendUrl = config('app.frontend_url');

// return redirect("{$frontendUrl}/login/callback")->withCookie(cookie('auth_token', $token, 60, '/', null, false, true));
return redirect("{$frontendUrl}/login/callback?token={$token}");
EncryptCookies::except('auth_token');
return redirect("{$frontendUrl}/api/login/google")->withCookie(cookie('auth_token', $token, 1, '/', null, false, true));

} catch (Exception $e) {
return response()->json([
Expand Down

0 comments on commit edf066b

Please sign in to comment.