oidc: inline the findAccount

This commit is contained in:
Girish Ramakrishnan
2025-06-11 21:02:36 +02:00
parent 8788867572
commit 5824c8ffd0

View File

@@ -631,7 +631,7 @@ async function interactionAbort(req, res, next) {
}
}
async function claims(userId/*, use, scope*/) {
async function getClaims(userId/*, use, scope*/) {
const [error, user] = await safe(users.get(userId));
if (error) return { error: 'user not found' };
@@ -661,13 +661,6 @@ async function claims(userId/*, use, scope*/) {
return claims;
}
async function findAccount(ctx, id) {
return {
accountId: id,
async claims(use, scope) { return await claims(id, use, scope); },
};
}
async function renderError(ctx, out, error) {
const data = {
ICON_URL: '/api/v1/cloudron/avatar',
@@ -728,7 +721,12 @@ async function start() {
}
const configuration = {
findAccount,
findAccount: async function(ctx, id) {
return {
accountId: id,
claims: async (use, scope) => await getClaims(id, use, scope)
};
},
renderError,
adapter: StorageAdapter,
interactions: {