File tree 2 files changed +4
-5
lines changed
2 files changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -138,10 +138,9 @@ const plugin: NetlifyPlugin = {
138
138
} else {
139
139
// Using the deploy prime url in production leads to issues because the unique deploy ID is part of the generated URL
140
140
// and will not match the expected URL in the callback URL of an OAuth application.
141
- const nextAuthUrl =
142
- process . env . CONTEXT === 'production'
143
- ? `${ process . env . URL } ${ basePath } `
144
- : `${ process . env . DEPLOY_PRIME_URL } ${ basePath } `
141
+ const nextAuthUrl = `${
142
+ process . env . CONTEXT === 'production' ? process . env . URL : process . env . DEPLOY_PRIME_URL
143
+ } ${ basePath } `
145
144
146
145
console . log ( `NextAuth package detected, setting NEXTAUTH_URL environment variable to ${ nextAuthUrl } ` )
147
146
config . config . env . NEXTAUTH_URL = nextAuthUrl
Original file line number Diff line number Diff line change @@ -278,7 +278,7 @@ describe('onBuild()', () => {
278
278
expect ( config . config . env . NEXTAUTH_URL ) . toEqual ( mockUserDefinedSiteUrl )
279
279
} )
280
280
281
- test ( 'sets the NEXTAUTH_URL to the URL when CONTEXT env variable is \'production\'' , async ( ) => {
281
+ test ( 'sets the NEXTAUTH_URL to the user defined site URL when CONTEXT env variable is \'production\'' , async ( ) => {
282
282
const mockUserDefinedSiteUrl = chance . url ( )
283
283
process . env . DEPLOY_PRIME_URL = chance . url ( )
284
284
process . env . URL = mockUserDefinedSiteUrl
You can’t perform that action at this time.
0 commit comments