Skip to content

Commit 221bc8e

Browse files
committedDec 8, 2022
fix(core): add protocol if missing
1 parent f856363 commit 221bc8e

File tree

1 file changed

+4
-1
lines changed
  • packages/next-auth/src/utils

1 file changed

+4
-1
lines changed
 

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

+4-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,10 @@ export function getURL(
4444

4545
if (!host) throw new TypeError("Invalid host")
4646

47-
return new URL(`${host}${url ?? ""}`)
47+
if (host.startsWith("http://") || host.startsWith("https://")) {
48+
return new URL(`${host}${url ?? ""}`)
49+
}
50+
return new URL(`https://${host}${url ?? ""}`)
4851
} catch (error) {
4952
return error as Error
5053
}

0 commit comments

Comments
 (0)
Please sign in to comment.