# Redirect to Socialite instead of a popup

> Socialite starts with a top-level redirect. A Vue popup loses the session cookie on the way back.

- URL: https://laravel-vuejs.space/socialite-redirect-not-popup
- Author: Anass Ez-zouaine (https://laravel-vuejs.space/author/anass-ez-zouaine)
- Published: 2026-10-11
- Topics: Laravel, VueJs, Socialite

People searching “Socialite Vue popup” open GitHub in `window.open` and then the callback has no session. The [Socialite guide](https://laravel-vuejs.space/laravel-socialite-vue) is the two routes. This page is the link.

> **TL;DR**
>
> -   Socialite starts with a top-level redirect.
> -   A Vue popup loses the session cookie on the way back.
> -   Do not put the provider secret in a `VITE_` variable so the popup can “start OAuth itself”.
> -   Do not add Vue Router for `/auth/github/callback`.
>
> **Who it's for:** Laravel + Vue developers
>
> **Applies to:** Laravel 13 · Vue 3

## The fix

```php
public function redirect(): RedirectResponse
{
    return Socialite::driver('github')->redirect();
}
```

The Vue page uses a normal anchor. Inertia’s `<Link>` is fine when it is a GET to your own app. It is not fine as a popup.

```vue
<a href="/auth/github/redirect">Continue with GitHub</a>
```

The callback hits Laravel, not a Vue route. Laravel writes the user and redirects home. The popup approach fails because the opener and the popup do not share the session the way people expect, and because GitHub’s page should replace the window.

## What to avoid

> **Gotcha**
>
> Do not put the provider secret in a `VITE_` variable so the popup can “start OAuth itself”. The secret stays in `.env`. Do not add Vue Router for `/auth/github/callback`.

## FAQ

**Q: How do I redirect to Socialite instead of a popup?**

Socialite starts with a top-level redirect. A Vue popup loses the session cookie on the way back.

**Q: What goes wrong with Socialite Vue popup?**

Many developers open GitHub in `window. Do not put the provider secret in a` VITE\_\` variable so the popup can "start OAuth itself".
