Last active
April 8, 2022 02:17
-
-
Save realStandal/2798512729bb397381e60e3bafd68447 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const handler = new DbAuthHandler({ | |
... | |
signup: { | |
handler: async ({ username, password, userAttributes: { birthDate } }) => { | |
// | |
validate(birthDate, ...) | |
// -- | |
try { | |
await db.user.create({ data: { ... } }) | |
} catch (err) { | |
... | |
} | |
} | |
} | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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