Track HiveGrid Cloud planning reference
This commit is contained in:
1 parent
b3d5ea6764
commit
e341c5938a
5784 files changed
+1104929
-3
No files matched your search
@@ -0,0 +1,40 @@
|
||||
import { loadRequiredWebConfig, type WebConfig } from "@toolctrl/config";
|
||||
|
||||
type AuthProviderRequestOptions = {
|
||||
request?: Request;
|
||||
webConfig?: WebConfig;
|
||||
};
|
||||
|
||||
// EU-Sterilisation (AD/EU-Stack): social OAuth login (GitHub/Google) is removed.
|
||||
// Authentication is Email+Password, Magic-Link and TOTP only. Keep this provider
|
||||
// registry so additional EU-compatible methods can slot in later.
|
||||
export type PublicAuthProviders = {
|
||||
magicLink: {
|
||||
enabled: boolean;
|
||||
configured: boolean;
|
||||
};
|
||||
};
|
||||
|
||||
export type ServerAuthProviders = {
|
||||
magicLink: {
|
||||
enabled: boolean;
|
||||
configured: boolean;
|
||||
};
|
||||
};
|
||||
|
||||
export function getPublicAuthProviders(options: AuthProviderRequestOptions): PublicAuthProviders {
|
||||
const providers = getServerAuthProviders(options);
|
||||
|
||||
return {
|
||||
magicLink: providers.magicLink,
|
||||
};
|
||||
}
|
||||
|
||||
export function getServerAuthProviders({ webConfig = loadRequiredWebConfig() }: AuthProviderRequestOptions): ServerAuthProviders {
|
||||
return {
|
||||
magicLink: {
|
||||
enabled: webConfig.magicLink.enabled,
|
||||
configured: webConfig.magicLink.enabled,
|
||||
},
|
||||
};
|
||||
}
|
||||
Reference in new issue
Block a user