oidc: refactor the StorageAdapter
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user