mirror of
https://github.com/documenso/documenso.git
synced 2025-11-15 17:21:41 +10:00
Merge branch 'main' into feat/delete-archive
This commit is contained in:
16
packages/lib/utils/is-valid-redirect-url.ts
Normal file
16
packages/lib/utils/is-valid-redirect-url.ts
Normal file
@ -0,0 +1,16 @@
|
||||
const ALLOWED_PROTOCOLS = ['http', 'https'];
|
||||
|
||||
export const isValidRedirectUrl = (value: string) => {
|
||||
try {
|
||||
const url = new URL(value);
|
||||
|
||||
console.log({ protocol: url.protocol });
|
||||
if (!ALLOWED_PROTOCOLS.includes(url.protocol.slice(0, -1).toLowerCase())) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
} catch {
|
||||
return false;
|
||||
}
|
||||
};
|
||||
3
packages/lib/utils/slugify.ts
Normal file
3
packages/lib/utils/slugify.ts
Normal file
@ -0,0 +1,3 @@
|
||||
export * from '@sindresorhus/slugify';
|
||||
|
||||
export { default as slugify } from '@sindresorhus/slugify';
|
||||
Reference in New Issue
Block a user