Skip to content

Commit 157269e

Browse files
committedDec 8, 2022
fix(core): throw error if no action can be determined
1 parent 221bc8e commit 157269e

File tree

1 file changed

+3
-2
lines changed
  • packages/next-auth/src/utils

1 file changed

+3
-2
lines changed
 

‎packages/next-auth/src/utils/node.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,12 @@ export function getURL(
4343
}
4444

4545
if (!host) throw new TypeError("Invalid host")
46+
if (!url) throw new TypeError("Invalid URL, cannot determine action")
4647

4748
if (host.startsWith("http://") || host.startsWith("https://")) {
48-
return new URL(`${host}${url ?? ""}`)
49+
return new URL(`${host}${url}`)
4950
}
50-
return new URL(`https://${host}${url ?? ""}`)
51+
return new URL(`https://${host}${url}`)
5152
} catch (error) {
5253
return error as Error
5354
}

0 commit comments

Comments
 (0)
Please sign in to comment.