mirror of
https://github.com/fosrl/pangolin.git
synced 2026-02-13 08:26:40 +00:00
rename auth and start work separating config
This commit is contained in:
11
server/utils/extractBaseDomain.ts
Normal file
11
server/utils/extractBaseDomain.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
export function extractBaseDomain(url: string): string {
|
||||
const newUrl = new URL(url);
|
||||
const hostname = newUrl.hostname;
|
||||
const parts = hostname.split(".");
|
||||
|
||||
if (parts.length <= 2) {
|
||||
return parts.join(".");
|
||||
}
|
||||
|
||||
return parts.slice(1).join(".");
|
||||
}
|
||||
Reference in New Issue
Block a user