Skip to content

basepath is not working in next-auth #12397

Answered by srayas
SrayasPMaatrum asked this question in Help
Discussion options

You must be logged in to vote

in my app i have configured the base path as /basepath in next.config so by this all the api's and url end point will now work with /basepath but every ones issue is with basepath, is not working as expected which we are setting in auth.ts in next-auth, i have found the the work around for this

for this we need to follow the below steps i am using Next 15,

step 1: set the /basepath in next config
const nextConfig = {
basePath: '/basepath', // this will set the basepath for all contents in /app directory
images: {
loader: 'default',
path: '/basepath/_next/image', // this will append the basepath for the image apis called by next
},
assetPrefix: process.env.NEXT_APP_BASE_URL // this is will…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@SrayasPMaatrum
Comment options

Answer selected by SrayasPMaatrum
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants