support Nextcloud OAuth 2.0 authentication

This commit is contained in:
MaysWind
2025-10-21 01:52:28 +08:00
parent 600ae2bd58
commit 53a8ad71c6
74 changed files with 2046 additions and 241 deletions
+16
View File
@@ -3,6 +3,14 @@ function getServerSetting(key: string): string | number | boolean | Record<strin
return settings[key];
}
export function isInternalAuthEnabled(): boolean {
return getServerSetting('a') !== 0;
}
export function isOAuth2Enabled(): boolean {
return getServerSetting('o') === 1;
}
export function isUserRegistrationEnabled(): boolean {
return getServerSetting('r') === 1;
}
@@ -31,6 +39,14 @@ export function isDataImportingEnabled(): boolean {
return getServerSetting('i') === 1;
}
export function getOAuth2Provider(): string {
return getServerSetting('op') as string;
}
export function getOIDCCustomDisplayNames(): Record<string, string>{
return getServerSetting('ocn') as Record<string, string>;
}
export function isMCPServerEnabled(): boolean {
return getServerSetting('mcp') === 1;
}