File tree Expand file tree Collapse file tree 1 file changed +14
-14
lines changed
packages/wallet/backend/src/gatehub Expand file tree Collapse file tree 1 file changed +14
-14
lines changed Original file line number Diff line number Diff line change @@ -109,17 +109,6 @@ export class GateHubService {
109
109
throw new NotFound ( )
110
110
}
111
111
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
-
123
112
const userState = await this . gateHubClient . getUserState ( user . gateHubUserId )
124
113
125
114
const userDetails : Partial < User > = {
@@ -135,11 +124,22 @@ export class GateHubService {
135
124
. join ( ', ' )
136
125
}
137
126
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
+ )
140
134
}
141
135
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
+ }
143
143
144
144
let customerId
145
145
if (
You can’t perform that action at this time.
0 commit comments