Skip to content

Commit 9154b58

Browse files
committed
fix issue with date comparison logic in sign up handler lambda
the comparison was the wrong way around so only let people under 13 sign up
1 parent 00ebf8d commit 9154b58

File tree

1 file changed

+1
-1
lines changed
  • src/pages/[platform]/build-a-backend/functions/examples/user-attribute-validation

1 file changed

+1
-1
lines changed

src/pages/[platform]/build-a-backend/functions/examples/user-attribute-validation/index.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ import type { PreSignUpTriggerHandler } from "aws-lambda"
5050
function isOlderThan(date: Date, age: number) {
5151
const comparison = new Date()
5252
comparison.setFullYear(comparison.getFullYear() - age)
53-
return date.getTime() > comparison.getTime()
53+
return date.getTime() <= comparison.getTime()
5454
}
5555

5656
export const handler: PreSignUpTriggerHandler = async (event) => {

0 commit comments

Comments
 (0)