Skip to content

Commit 623a57e

Browse files
Merge branch 'main' into rp/generate-user-keypair
2 parents 6259a0f + a8bf42d commit 623a57e

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

packages/wallet/backend/src/gatehub/service.ts

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -109,17 +109,6 @@ export class GateHubService {
109109
throw new NotFound()
110110
}
111111

112-
if (!isApproved) {
113-
isApproved = await this.gateHubClient.connectUserToGateway(
114-
user.gateHubUserId,
115-
this.env.GATEHUB_GATEWAY_UUID
116-
)
117-
}
118-
119-
this.logger.info(
120-
`User ${user.id} with gatehub id ${user.gateHubUserId} CONNECTED TO GATEWAY`
121-
)
122-
123112
const userState = await this.gateHubClient.getUserState(user.gateHubUserId)
124113

125114
const userDetails: Partial<User> = {
@@ -135,11 +124,22 @@ export class GateHubService {
135124
.join(', ')
136125
}
137126

138-
if (isApproved) {
139-
userDetails.kycVerified = true
127+
await User.query().findById(user.id).patch(userDetails)
128+
129+
if (!isApproved) {
130+
isApproved = await this.gateHubClient.connectUserToGateway(
131+
user.gateHubUserId,
132+
this.env.GATEHUB_GATEWAY_UUID
133+
)
140134
}
141135

142-
await User.query().findById(user.id).patch(userDetails)
136+
this.logger.info(
137+
`User ${user.id} with gatehub id ${user.gateHubUserId} CONNECTED TO GATEWAY`
138+
)
139+
140+
if (isApproved) {
141+
await this.updateUserFlag(user.id, { kycVerified: true })
142+
}
143143

144144
let customerId
145145
if (

0 commit comments

Comments
 (0)