Revert "issue-129 Add custom auth ui/ux"

This reverts commit fc4906757a.
This commit is contained in:
Kurt Hutten
2020-12-05 18:06:07 +11:00
parent 73e1dccdb8
commit 04820ebd2d
23 changed files with 26 additions and 548 deletions

View File

@@ -18,7 +18,7 @@ export const handler = async (req, _context) => {
email: 'k.hutten@protonmail.ch',
confirmation_sent_at: '2020-10-19T18:09:01Z',
app_metadata: { provider: 'email' },
user_metadata: { full_name: 'sick_dog', userName: 'hi bob' },
user_metadata: { full_name: 'sick_dog' },
created_at: '2020-10-19T18:09:01Z',
updated_at: '2020-10-19T18:09:01Z'
}
@@ -62,12 +62,12 @@ export const handler = async (req, _context) => {
db.user.findOne({
where: { userName: seed },
})
const userNameSeed = enforceAlphaNumeric(user?.user_metadata?.userName)
const userNameSeed = enforceAlphaNumeric(email.split('@')[0])
const userName = await generateUniqueString(userNameSeed, isUniqueCallback) // TODO maybe come up with a better default userName?
const input = {
email,
userName,
name: user?.user_metadata?.full_name,
name: user.user_metadata && user.user_metadata.full_name,
id: user.id,
}
await createUserInsecure({ input })

View File

@@ -70,7 +70,7 @@ import { AuthenticationError, ForbiddenError, parseJWT } from '@redwoodjs/api'
* return await db.user.findOne({ where: { decoded.email } })
* }
*
* @example - User info is contained in the decoded token and roles extracted
* @example - User info is conatined in the decoded token and roles extracted
*
* export const getCurrentUser = async (decoded, { _token, _type }) => {
* return { ...decoded, roles: parseJWT({ decoded }).roles }