0b2d65a4e9
Mobile app detects SSO per server, supports OAuth sign-in, and preserves saved sessions when adding accounts. Tab screens get proper chrome layout and tab-bar clearance with scrollable page headers. Co-authored-by: Cursor <cursoragent@cursor.com>
22 lines
551 B
TypeScript
22 lines
551 B
TypeScript
export type AuthCapabilities = {
|
|
authentik: boolean;
|
|
signupsDisabled: boolean;
|
|
};
|
|
|
|
const DEFAULT_CAPABILITIES: AuthCapabilities = {
|
|
authentik: false,
|
|
signupsDisabled: false,
|
|
};
|
|
|
|
export async function fetchAuthCapabilities(apiUrl: string): Promise<AuthCapabilities> {
|
|
const base = apiUrl.replace(/\/$/, "");
|
|
|
|
try {
|
|
const response = await fetch(`${base}/api/auth/capabilities`);
|
|
if (!response.ok) return DEFAULT_CAPABILITIES;
|
|
return (await response.json()) as AuthCapabilities;
|
|
} catch {
|
|
return DEFAULT_CAPABILITIES;
|
|
}
|
|
}
|