@@ -242,16 +242,16 @@ async function revokeByUsername(username) {
|
||||
async function consumeAuthCode(authCode) {
|
||||
assert.strictEqual(typeof authCode, 'string');
|
||||
|
||||
let userId = null;
|
||||
let username = null;
|
||||
await StorageAdapter.updateData('AuthorizationCode', (data) => {
|
||||
const authData = data[authCode];
|
||||
if (authData) {
|
||||
userId = authData.payload.accountId;
|
||||
username = authData.payload.accountId;
|
||||
authData.consumed = true;
|
||||
}
|
||||
});
|
||||
|
||||
return userId;
|
||||
return username;
|
||||
}
|
||||
|
||||
// This exposed to run on a cron job
|
||||
|
||||
Reference in New Issue
Block a user