oidc: refactor the StorageAdapter

This commit is contained in:
Girish Ramakrishnan
2025-06-13 01:06:50 +02:00
parent 25684bf4f6
commit b60681e9bd
2 changed files with 107 additions and 153 deletions

View File

@@ -150,10 +150,8 @@ async function callback(req, res, next) {
debug(`callback: with code ${req.query.code}`);
req.user = await oidcServer.getUserByAuthCode(req.query.code);
// this is one-time use
await oidcServer.consumeAuthCode(req.query.code);
const userId = await oidcServer.consumeAuthCode(req.query.code);
if (userId) req.user = await users.get(userId);
next();
}