Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Edge Compatibility Auth.Config.ts #12488

Open
KahtavaJ opened this issue Jan 10, 2025 · 0 comments
Open

Edge Compatibility Auth.Config.ts #12488

KahtavaJ opened this issue Jan 10, 2025 · 0 comments
Labels
triage Unseen or unconfirmed by a maintainer yet. Provide extra information in the meantime.

Comments

@KahtavaJ
Copy link

What is the improvement or update you wish to see?

Is it possible to add a few more pieces to the Auth.Config.ts area of this page so we can potentially get a more complete middleware example.

import GitHub from "next-auth/providers/github"
import type { NextAuthConfig } from "next-auth"

export default {
providers: [GitHub],
pages: {signIn: "/signin"},
session: {strategy: "jwt"},
callbacks: {
authorized: async ({ request, auth }) =>
{
return !!auth;
},
},
} satisfies NextAuthConfig

Is there any context that might help us understand?

I'm not sure if this concept should have been really clear or not and maybe im still doing it wrong but it took me a number of hours to realize that when splitting the configuration piece that almost everything can be placed in the Auth.Config.ts file and only the "adapter" property appears to be required in the Auth.ts file.

It wasnt until I found this NextJS article that I realized I had properties in the wrong file.
https://nextjs.org/learn/dashboard-app/adding-authentication#protecting-your-routes-with-nextjs-middleware

Does the docs page already exist? Please link to it.

https://authjs.dev/guides/edge-compatibility

@KahtavaJ KahtavaJ added the triage Unseen or unconfirmed by a maintainer yet. Provide extra information in the meantime. label Jan 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
triage Unseen or unconfirmed by a maintainer yet. Provide extra information in the meantime.
Projects
None yet
Development

No branches or pull requests

1 participant