We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5503878 commit df6977aCopy full SHA for df6977a
apps/web/pages/api/forgot-password/index.ts
@@ -9,7 +9,13 @@ async function checkDomain(host: string) {
9
if (process.env.NODE_ENV === 'development') {
10
return true;
11
}
12
- const domain = host.substring(host.lastIndexOf('/') + 1);
+ let domain = host;
13
+ try {
14
+ const url = new URL(host);
15
+ domain = url.hostname;
16
+ } catch (error) {
17
+ console.error('Invalid URL:', error);
18
+ }
19
if (domain === 'linen.dev' || domain === 'www.linen.dev') {
20
21
0 commit comments