mirror of
https://github.com/fosrl/pangolin.git
synced 2025-08-28 05:44:01 +02:00
rename auth and start work separating config
This commit is contained in:
parent
d447de9e8a
commit
b199595100
15 changed files with 153 additions and 120 deletions
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(".");
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue