fix(server/authcode): guard against null challenges (#2643)
- the database expects challenge to be not null, so we should guard against this early before consuming database resources
This commit is contained in:
@@ -204,6 +204,8 @@ module.exports = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
async createAuthorizationCode({ appId, userId, challenge }) {
|
async createAuthorizationCode({ appId, userId, challenge }) {
|
||||||
|
if (!challenge) throw new Error('Please provide a valid challenge.')
|
||||||
|
|
||||||
const ac = {
|
const ac = {
|
||||||
id: crs({ length: 42 }),
|
id: crs({ length: 42 }),
|
||||||
appId,
|
appId,
|
||||||
|
|||||||
Reference in New Issue
Block a user