Skip to content
Discussion options

You must be logged in to vote

Hello! I'd just liked to say what worked for me in the end is removing the export in front of export const authOptions: NextAuthOptions as that for some reason does not seem to work when building to production - this makes the solution viable for NextJS 13 using route handlers which requires route.ts to be the file for an endpoint. (This applies to my original code).

I'd just like to say if this doesn't work for you - please refer to @devjiwonchoi's code which can be found above and is also very helpful for a number of optimisations in my project and Next in general.

import NextAuth, { NextAuthOptions } from "next-auth";
import DiscordProvider from "next-auth/providers/discord";

const au…

Replies: 8 comments 30 replies

Comment options

You must be logged in to vote
20 replies
@Coderamrin
Comment options

@Coderamrin
Comment options

@vuongManabie
Comment options

@devvf
Comment options

Answer selected by devvf
@Kofichamp
Comment options

@AuthorOfTheSurf
Comment options

@HickAndrade
Comment options

@volodymyrfilon
Comment options

Comment options

You must be logged in to vote
2 replies
@denniztr
Comment options

@nicitaacom
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
6 replies
@burn-c
Comment options

@Vancelott
Comment options

@burn-c
Comment options

@Vancelott
Comment options

@mergd
Comment options

Comment options

You must be logged in to vote
2 replies
@andreimacavei
Comment options

@nestorvave
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet