This commit is contained in:
Arunavo Ray
2025-07-26 22:06:29 +05:30
parent 0920314679
commit 5f45a9a03d
7 changed files with 459 additions and 86 deletions

View File

@@ -88,22 +88,8 @@ export async function POST(context: APIContext) {
}
} = body;
// Handle provider-specific scope defaults
let finalScopes = scopes;
if (!finalScopes) {
// Check if this is a Google provider
const isGoogle = issuer.includes('google.com') ||
issuer.includes('googleapis.com') ||
domain.includes('google.com');
if (isGoogle) {
// Google doesn't support offline_access scope
finalScopes = ["openid", "email", "profile"];
} else {
// Default scopes for other providers
finalScopes = ["openid", "email", "profile", "offline_access"];
}
}
// Use provided scopes or default if not specified
const finalScopes = scopes || ["openid", "email", "profile"];
registrationBody.oidcConfig = {
clientId,