Skip to content

Instantly share code, notes, and snippets.

@realStandal
Last active April 8, 2022 02:17
Show Gist options
  • Save realStandal/2798512729bb397381e60e3bafd68447 to your computer and use it in GitHub Desktop.
Save realStandal/2798512729bb397381e60e3bafd68447 to your computer and use it in GitHub Desktop.
const handler = new DbAuthHandler({
...
signup: {
handler: async ({ username, password, userAttributes: { birthDate } }) => {
//
validate(birthDate, ...)
// --
try {
await db.user.create({ data: { ... } })
} catch (err) {
...
}
}
}
})
const SignupPage = () => {
const { signUp } = useAuth()
const onSignup = () => {
...
const res = await signUp({ username, password, birthDate })
}
return ...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment