We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 649a392 + 78881a8 commit 5b733b4Copy full SHA for 5b733b4
1 file changed
libs/mobile/auth/features/email-sign-in-form/src/lib/forms/email-form.ts
@@ -21,12 +21,13 @@ export class EmailFormSchema {
21
.url(i18n.t('SHARED.VALIDATION.TEXT_INVALID_URL'))
22
.test('no-path', i18n.t('SHARED.VALIDATION.TEXT_INVALID_URL'), (value) => {
23
if (!value) return true;
24
- if (value.endsWith('/')) return false;
25
26
try {
27
- const url = new URL(value);
+ const normalizedValue = value.trim();
+ const url = new URL(normalizedValue);
28
+ const normalizedPath = url.pathname.replace(/\/+$/, '/');
29
- return url.pathname === '/' && !url.search && !url.hash;
30
+ return normalizedPath === '/' && !url.search && !url.hash;
31
} catch {
32
return false;
33
}
0 commit comments