#`AuthProviderDiscoveryFailed` when running `convex dev --local` with Convex Auth

2 messages · Page 1 of 1 (latest)

jolly linden
#

We're using Convex Auth and have no issues with email OTP when using cloud dev deployments

However, when trying it against a local convex dev deployment, we run into these issues:

Returning false from isAuthenticated because Error: {"code":"AuthProviderDiscoveryFailed","message":"Auth provider discovery of http://127.0.0.1:3211 failed"}
    at async isAuthenticated (../../../src/nextjs/server/index.tsx:306:11)
    at async (website/middleware.ts:13:28)
    at async (../../../src/nextjs/server/index.tsx:227:8)
  11 |
  12 | export default convexAuthNextjsMiddleware(async (request, { convexAuth }) => {
> 13 |     const isAuthenticated = await convexAuth.isAuthenticated();
     |                            ^
  14 |
  15 |     // Handle root page routing with rewrite
  16 |     if (isRootPage(request)) { {
  
}

When hardcoding the following URL:

export default {
    providers: [
        {
            // domain: process.env.CONVEX_SITE_URL,
            domain: "https://localhost:3211",
            applicationID: "convex",
        },
    ],
};
Returning false from isAuthenticated because Error: {"code":"NoAuthProvider","message":"No auth provider found matching the given token. Check that your JWT's issuer and audience match one of your configured providers: [OIDC(domain=https://localhost:3211, app_id=convex)]"}
    at async isAuthenticated (../../../src/nextjs/server/index.tsx:306:11)
    at async (website/middleware.ts:13:28)
    at async (../../../src/nextjs/server/index.tsx:227:8)
  11 |
  12 | export default convexAuthNextjsMiddleware(async (request, { convexAuth }) => {
> 13 |     const isAuthenticated = await convexAuth.isAuthenticated();
     |                            ^
  14 |
  15 |     // Handle root page routing with rewrite
  16 |     if (isRootPage(request)) { {
  
}

What's the way to solve this?

turbid birchBOT
#

Thanks for posting in #1088161997662724167.
Reminder: If you have a Convex Pro account, use the Convex Dashboard to file support tickets.

    - Provide context: What are you trying to achieve, what is the end-user interaction, what are you seeing? (full error message, command output, etc.)
    - Use [search.convex.dev](https://search.convex.dev) to search Docs, Stack, and Discord all at once.
    - Additionally, you can post your questions in the Convex Community's #1228095053885476985 channel to receive a response from AI.
    - Avoid tagging staff unless specifically instructed.

    Thank you!