Skip to content

Commit

Permalink
chore(adapter-nextjs): add warning re: using http in production (#14134)
Browse files Browse the repository at this point in the history
  • Loading branch information
HuiSF authored Jan 13, 2025
1 parent 3f2f826 commit 89ec3fd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions packages/adapter-nextjs/src/auth/utils/origin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@ export const isValidOrigin = (origin: string): boolean => {
try {
const url = new URL(origin);

if (url.protocol === 'http:' && url.hostname !== 'localhost') {
console.warn(
'HTTP origin detected. This is insecure and should only be used for local development.',
);
}

return (
(url.protocol === 'http:' || url.protocol === 'https:') &&
originRegex.test(origin)
Expand Down

0 comments on commit 89ec3fd

Please sign in to comment.