Next.js Discord

Discord Forum

Provide connection query parameter auth0?

Unanswered
Glaucous-winged Gull posted this in #help-forum
Open in Discord
Glaucous-winged GullOP
How can I provide the identity provider depending on a query parameter to my /api/auth/login, for example if I have my my-app/src/app/api/auth/[auth0]/route.ts defined as:
import { handleAuth, handleLogin } from "@auth0/nextjs-auth0";

export const GET = handleAuth({
    login: handleLogin({
        authorizationParams: {
            connection: 'github',
        }
    })
});

I would login to github when I made a request to that endpoint, however I would like to have the connection param to be provided by the user (maybe as a Login with <provider> button. Is confiurable without having to make a custom api endpoint for each provider or there's no way around that?

0 Replies