issue-129 Update signin/up ui-ux

Getting rid of the netlify widgit and rolling our own, gives us the
flexibility to also add the username into the signup process as well
as allow the user to opt into the newsletter at the same time.

Auth is still netlify, via their "gotrue", we're just handling the more
of it.
This commit is contained in:
Kurt Hutten
2020-12-05 18:16:30 +11:00
parent 46e370531f
commit d3d73ca475
20 changed files with 535 additions and 21 deletions

View File

@@ -62,12 +62,12 @@ export const handler = async (req, _context) => {
db.user.findOne({
where: { userName: seed },
})
const userNameSeed = enforceAlphaNumeric(email.split('@')[0])
const userNameSeed = enforceAlphaNumeric(user?.user_metadata?.userName)
const userName = await generateUniqueString(userNameSeed, isUniqueCallback) // TODO maybe come up with a better default userName?
const input = {
email,
userName,
name: user.user_metadata && user.user_metadata.full_name,
name: user?.user_metadata?.full_name,
id: user.id,
}
await createUserInsecure({ input })