proxyauth: oidc server returns username now

See 846986987d
This commit is contained in:
Girish Ramakrishnan
2025-07-09 18:06:50 +02:00
parent 2513ade3c4
commit fd61a0bfbf
2 changed files with 6 additions and 5 deletions

View File

@@ -150,8 +150,9 @@ async function callback(req, res, next) {
debug(`callback: with code ${req.query.code}`);
const userId = await oidcServer.consumeAuthCode(req.query.code);
if (userId) req.user = await users.get(userId);
const username = await oidcServer.consumeAuthCode(req.query.code);
if (!username) return next(new HttpError(400, 'invalid "code"'));
req.user = await users.getByUsername(username);
next();
}