Skip to content

Commit

Permalink
fix: post signup hook for ee was using user without platform id
Browse files Browse the repository at this point in the history
  • Loading branch information
AbdulTheActivePiecer committed Dec 5, 2023
1 parent 4b118c2 commit d6a3af7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
Expand Up @@ -42,7 +42,7 @@ export const enterpriseAuthenticationServiceHooks: AuthenticationServiceHooks =
value: true,
})

const updatedUser = await authenticationHelper.autoVerifyUserIfEligible(user)
const updatedUser = await authenticationHelper.autoVerifyUserIfEligible((await userService.getOneOrFail({ id: user.id })))

const { project: updatedProject, token } = await authenticationHelper.getProjectAndTokenOrThrow(user)
return {
Expand Down
3 changes: 3 additions & 0 deletions packages/backend/src/app/user/user-service.ts
Expand Up @@ -33,6 +33,9 @@ export const userService = {
async get({ id }: IdParams): Promise<User | null> {
return userRepo.findOneBy({ id })
},
async getOneOrFail({ id }: IdParams): Promise<User> {
return userRepo.findOneByOrFail({ id })
},

async getMetaInfo({ id }: IdParams): Promise<UserMeta | null> {
const user = await this.get({ id })
Expand Down

0 comments on commit d6a3af7

Please sign in to comment.