Skip to content
This repository was archived by the owner on Oct 10, 2025. It is now read-only.
This repository was archived by the owner on Oct 10, 2025. It is now read-only.

Send token in query param instead of anchor #221

@t1v1

Description

@t1v1

Feature request

Is your feature request related to a problem? Please describe.

I have to create a row in a custom public.users table immediately after a new user signs up (with Google). After logging in with Google, I've specified the redirectTo the /api/auth endpoint (which is a Next.js API route) which creates that row. However, I can't get the access_token sent by Supabase because it's in a URL fragment (i.e. using #) which is inaccessible to servers:

The fragment identifier functions differently to the rest of the URI: its processing is exclusively client-sided with no participation from the web server, though the server typically helps to determine the MIME type, and the MIME type determines the processing of fragments.

Describe the solution you'd like

Instead of sending the #access_token=asdf using a URL fragment (i.e. the # anchor spec), Supabase should make it a query parameter (i.e. ?access_token=asdf) so it's accessible to server-side environments.

Describe alternatives you've considered

Instead of redirecting to /api/auth, I redirect to a client-side loading page, perform the login, and then send the resulting user to the back-end using a POST request before redirecting to the rest of the app. This adds significant loading time to the whole process.

Additional context

Related to #2

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions