Skip to content

Commit

Permalink
fix(endpoints) setpassword minor change
Browse files Browse the repository at this point in the history
  • Loading branch information
Codetrauma committed Nov 11, 2023
1 parent 4330382 commit 7965872
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/endpoints/rooms/rooms.ts
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ router.post('/checkpasswordhash/:id', limiter, (req: Request, res: Response) =>

router.post('/setpassword/:id', limiter, asyncHandler(async (req: Request, res: Response) => {
const { id } = req.params;
const { passwordHash, idc, proof } = req.body as { passwordHash: string, idc: string, proof: IDCProof };
const { passwordHash, proof } = req.body as { passwordHash: string, proof: IDCProof };
const isValid = await verifyIdentityProof(proof);

if (isValid) {
Expand All @@ -305,7 +305,7 @@ router.post('/setpassword/:id', limiter, asyncHandler(async (req: Request, res:
}
}).then((room) => {
if (room) {
if (!room.adminIdentities.includes(idc)) {
if (!room.adminIdentities.includes(proof.publicSignals.identityCommitment)) {
res.status(401).json({ success: false, message: 'Identity not authorized' });
return;
}
Expand Down

0 comments on commit 7965872

Please sign in to comment.