Skip to content

Commit

Permalink
change signature expiration to days instead seconds (#378)
Browse files Browse the repository at this point in the history
  • Loading branch information
Joao Pedro da Silva authored Aug 8, 2022
1 parent 65a75db commit 41f312e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/api/src/middlewares/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ export function verifySignature(
// validate signature timestamp
const timestamp = message as string;
const expirationDate = new Date();
expirationDate.setSeconds(expirationDate.getSeconds() - config.signatureExpiration);
expirationDate.setDate(expirationDate.getDate() - config.signatureExpiration);
if (!timestamp || parseInt(timestamp) < expirationDate.getTime()) {
res.status(403).json({
success: false,
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/config/validatenv.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ function validateEnv() {
SUBGRAPH_URL: str({ devDefault: onlyOnTestEnv('xyz') }),
COUNCIL_SUBGRAPH_URL: str({ devDefault: onlyOnTestEnv('xyz') }),
IMAGE_HANDLER_URL: str({ devDefault: onlyOnTestEnv('xyz') }),
SIGNATURE_EXPIRATION: num({ default: 864000 }),
SIGNATURE_EXPIRATION: num({ default: 15 }),
SIGNATURE_MESSAGE: str({ devDefault: onlyOnTestEnv('xyz') }),
});
}
Expand Down

0 comments on commit 41f312e

Please sign in to comment.