Skip to content

Commit

Permalink
fix: do not add path if origin was provided
Browse files Browse the repository at this point in the history
  • Loading branch information
zoey-kaiser committed Sep 18, 2024
1 parent 4592a6d commit 42708f3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ export default defineNuxtModule<ModuleOptions>({
const logger = useLogger(PACKAGE_NAME)

// 0. Assemble all options
let baseURL = userOptions.baseURL ?? ''
let baseURL = userOptions.baseURL ?? '/api/auth'
if (userOptions.originEnvKey) {
const envFromRuntimeConfig = extractFromRuntimeConfig(nuxt.options.runtimeConfig, userOptions.originEnvKey)
const envOrigin = envFromRuntimeConfig ?? process.env[userOptions.originEnvKey]
Expand All @@ -117,7 +117,7 @@ export default defineNuxtModule<ModuleOptions>({
}
}

const { origin, pathname = '/api/auth' } = getOriginAndPathnameFromURL(baseURL)
const { origin, pathname = '' } = getOriginAndPathnameFromURL(baseURL)

const selectedProvider = userOptions.provider?.type ?? 'authjs'

Expand Down

0 comments on commit 42708f3

Please sign in to comment.