Added user tab and oauth2, streamlined readme

This commit is contained in:
fuomag9
2025-12-28 15:14:56 +01:00
parent f8a673cc03
commit be21f46ad5
28 changed files with 3213 additions and 245 deletions

View File

@@ -157,6 +157,17 @@ export const config = {
},
get adminPassword() {
return getAdminCredentials().password;
},
oauth: {
enabled: process.env.OAUTH_ENABLED === "true",
providerName: process.env.OAUTH_PROVIDER_NAME ?? "OAuth2",
clientId: process.env.OAUTH_CLIENT_ID ?? null,
clientSecret: process.env.OAUTH_CLIENT_SECRET ?? null,
issuer: process.env.OAUTH_ISSUER ?? null,
authorizationUrl: process.env.OAUTH_AUTHORIZATION_URL ?? null,
tokenUrl: process.env.OAUTH_TOKEN_URL ?? null,
userinfoUrl: process.env.OAUTH_USERINFO_URL ?? null,
allowAutoLinking: process.env.OAUTH_ALLOW_AUTO_LINKING === "true",
}
};
@@ -174,3 +185,25 @@ export function validateProductionConfig() {
const ___ = config.adminPassword;
}
}
/**
* Returns list of enabled OAuth providers based on configuration.
* Only includes providers that have complete credentials configured.
*/
export function getEnabledOAuthProviders(): Array<{id: string; name: string}> {
const providers: Array<{id: string; name: string}> = [];
if (
config.oauth.enabled &&
config.oauth.clientId &&
config.oauth.clientSecret &&
config.oauth.issuer
) {
providers.push({
id: "oauth2",
name: config.oauth.providerName
});
}
return providers;
}