mirror of
https://github.com/Afilmory/afilmory
synced 2026-02-01 22:48:17 +00:00
refactor(server): tanant auth (#148)
Signed-off-by: Innei <tukon479@gmail.com>
This commit is contained in:
@@ -3,4 +3,5 @@ export * from './cn'
|
||||
export * from './semaphore'
|
||||
export * from './spring'
|
||||
export * from './storage-provider'
|
||||
export * from './tenant'
|
||||
export * from './u8array'
|
||||
|
||||
12
packages/utils/src/tenant.ts
Normal file
12
packages/utils/src/tenant.ts
Normal file
@@ -0,0 +1,12 @@
|
||||
const RESERVED_SLUGS = ['admin', 'docs', 'support', 'status', 'api', 'assets', 'static', 'www'] as const
|
||||
|
||||
export const RESERVED_TENANT_SLUGS = RESERVED_SLUGS
|
||||
|
||||
export type ReservedTenantSlug = (typeof RESERVED_TENANT_SLUGS)[number]
|
||||
|
||||
export function isTenantSlugReserved(slug: string): boolean {
|
||||
const normalized = slug.trim().toLowerCase()
|
||||
return RESERVED_TENANT_SLUGS.includes(normalized as ReservedTenantSlug)
|
||||
}
|
||||
|
||||
export const DEFAULT_BASE_DOMAIN = 'afilmory.art'
|
||||
Reference in New Issue
Block a user