nowaythatworked/auth-astro

"Provider "auth0" is missing both `issuer` and `authorization` endpoint config. At least one of them is required.. Read more at https://errors.authjs.dev#invalidendpoints"

Closed this issue · 1 comments

I already spoke with @TheOtterlord about this problem in his discord server but wants to open an issue for remainder and progress. For who doesn't know about it:

When ı first tried to use auth-astro , as an early package ı had some problems but somehow worked. I got some information about my user. After 3-4 day, ı want to tried to use for my project and wants to build an mini project for learn set up correctly. Added with astro add and configured for usage. Problem is, this time gave me this error:

Provider "auth0" is missing both issuer and authorization endpoint config. At least one of them is required.. Read more at https://errors.authjs.dev#invalidendpoints

I spoke with @TheOtterlord and we tried to work around with issuer: "" but didn't worked. Tried to give auth endpoint with authorization endpoint prop but still same. Idk this happened right now and didn't throw error when ı first tried. Auth-astro didn't merged any commit in this time, ı think it's about authjs changes.


Going to add some schreenshots for my really mini setup:

astro.config.mjs
Screenshot from 2023-04-17 10-38-11

index.astro
Screenshot from 2023-04-17 11-08-37

NoxelS commented

You need an issuer to target a specific Auth0 application. Your config should look like something this.:

import Auth0Provider from 'next-auth/providers/auth0';

export default {
    providers: [
        Auth0Provider({
            clientId: process.env.AUTH0_CLIENT_ID,
            clientSecret: process.env.AUTH0_CLIENT_SECRET,
            issuer: process.env.AUTH0_ISSUER
        })
    ]
};