Skip to content

Commit f9ef4d2

Browse files
committed
Fix OAuth redirection to the provider
1 parent 55ddca7 commit f9ef4d2

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

app/Http/Controllers/Auth/OAuthController.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,17 @@
1717
use Illuminate\Support\Facades\Auth;
1818
use Illuminate\Support\Facades\Hash;
1919
use Illuminate\Support\Str;
20+
use Inertia\Inertia;
2021
use Laravel\Socialite\Facades\Socialite;
2122
use SocialiteProviders\Azure\User as AzureUser;
23+
use Symfony\Component\HttpFoundation\Response;
2224

2325
final readonly class OAuthController
2426
{
2527
public function create(
2628
OAuthRequest $request,
2729
GetAvailableOAuthProviders $getAvailableOAuthProviders,
28-
): RedirectResponse {
30+
): Response {
2931
try {
3032
$provider = $request->safe()->string('provider')->value();
3133
$isValidProvider = in_array(
@@ -42,7 +44,7 @@ public function create(
4244

4345
$url = Socialite::driver($provider)->redirect()->getTargetUrl();
4446

45-
return redirect($url);
47+
return Inertia::location($url);
4648
} catch (Exception) {
4749
abort(404);
4850
}

0 commit comments

Comments
 (0)