Skip to content

Commit

Permalink
add more multisig confirmation conditions
Browse files Browse the repository at this point in the history
  • Loading branch information
CarlosQ96 committed Sep 23, 2023
1 parent 3f8a48d commit 126d50c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
6 changes: 5 additions & 1 deletion src/entities/multisigSession.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,11 @@ export class MultisigSession extends BaseEntity {

if (this.isExpired()) this.status = MultisigStatuses.Failed;

if (safeMessageData.status === 'CONFIRMED')
if (
safeMessageData.status === 'CONFIRMED' &&
safeMessageData.confirmationsSubmitted >=
safeMessageData.confirmationsRequired
)
this.status = MultisigStatuses.Successful;

await this.save();
Expand Down
5 changes: 3 additions & 2 deletions src/routes/v1/multisigAuthenticationRouter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@ multisigAuthenticationRouter.post(
'/multisigAuthentication',
async (req: Request, res: Response, next) => {
try {
const { safeMessageTimestamp, safeAddress, network, jwt } = req.body;
if (!safeMessageTimestamp || !safeAddress || !jwt || !network) {
const { safeAddress, network, jwt } = req.body;
const safeMessageTimestamp = req.body?.safeMessageTimestamp;
if (!safeAddress || !jwt || !network) {
res.status(422).json({ message: errorMessagesEnum.MISSING_LOGIN_DATA });
return;
}
Expand Down

0 comments on commit 126d50c

Please sign in to comment.