mirror of
https://github.com/omnivore-app/omnivore.git
synced 2026-03-11 08:54:26 +00:00
create pending user first
This commit is contained in:
parent
35e060890e
commit
ba73eec9e5
2 changed files with 6 additions and 1 deletions
|
|
@ -350,6 +350,7 @@ export const signupResolver: ResolverFn<
|
|||
pictureUrl: pictureUrl || undefined,
|
||||
bio: bio || undefined,
|
||||
password: hashedPassword,
|
||||
pendingConfirmation: true,
|
||||
})
|
||||
|
||||
return {
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import { AuthProvider } from '../routers/auth/auth_types'
|
||||
import { MembershipTier } from '../datalayer/user/model'
|
||||
import { MembershipTier, StatusType } from '../datalayer/user/model'
|
||||
import { EntityManager } from 'typeorm'
|
||||
import { User } from '../entity/user'
|
||||
import { Profile } from '../entity/profile'
|
||||
|
|
@ -22,6 +22,7 @@ export const createUser = async (input: {
|
|||
membershipTier?: MembershipTier
|
||||
inviteCode?: string
|
||||
password?: string
|
||||
pendingConfirmation?: boolean
|
||||
}): Promise<[User, Profile]> => {
|
||||
const existingUser = await getUser(input.email)
|
||||
if (existingUser) {
|
||||
|
|
@ -68,6 +69,9 @@ export const createUser = async (input: {
|
|||
email: input.email,
|
||||
sourceUserId: input.sourceUserId,
|
||||
password: input.password,
|
||||
status: input.pendingConfirmation
|
||||
? StatusType.Pending
|
||||
: StatusType.Active,
|
||||
})
|
||||
const profile = await t.getRepository(Profile).save({
|
||||
username: input.username,
|
||||
|
|
|
|||
Loading…
Reference in a new issue