Skip to content

Commit 3fcc1cc

Browse files
authored
fix issue with date comparison logic in sign up handler lambda (#8339)
the comparison was the wrong way around so only let people under 13 sign up
1 parent a3cd346 commit 3fcc1cc

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)