File tree Expand file tree Collapse file tree 2 files changed +9
-6
lines changed
packages/wallet/backend/src Expand file tree Collapse file tree 2 files changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -95,7 +95,7 @@ export class AccountService implements IAccountService {
95
95
assetId : args . assetId ,
96
96
assetScale : asset . scale ,
97
97
gateHubWalletId,
98
- card : args . cardId
98
+ cardId : args . cardId
99
99
} )
100
100
101
101
// On creation account will have balance 0
@@ -111,8 +111,6 @@ export class AccountService implements IAccountService {
111
111
) : Promise < Account [ ] > {
112
112
const user = await User . query ( ) . findById ( userId )
113
113
114
- console . log ( 'user' , JSON . stringify ( user , null , 2 ) )
115
-
116
114
// NOT HERE
117
115
if ( ! user || ! user . gateHubUserId ) {
118
116
throw new NotFound ( )
@@ -204,8 +202,6 @@ export class AccountService implements IAccountService {
204
202
. findById ( account . userId )
205
203
. select ( 'gateHubUserId' )
206
204
207
- console . log ( 'getAccountBalance - user' , JSON . stringify ( user , null , 2 ) )
208
-
209
205
if ( ! user || ! user . gateHubUserId ) {
210
206
throw new NotFound ( )
211
207
}
Original file line number Diff line number Diff line change 1
1
import type { NextFunction , Request , Response } from 'express'
2
2
import { Unauthorized } from '@shared/backend'
3
+ import { User } from '@/user/model'
3
4
4
5
const KYCRoutes = [ '/iframe-urls/onboarding' , '/gatehub/add-user-to-gateway' ]
5
6
@@ -15,7 +16,13 @@ export const isAuth = async (
15
16
}
16
17
17
18
if ( ! KYCRoutes . includes ( req . url ) && req . session . user . needsIDProof ) {
18
- throw new Unauthorized ( 'Unauthorized' )
19
+ const user = await User . query ( ) . findById ( req . session . user . id )
20
+ if ( user ?. kycVerified ) {
21
+ req . session . user . needsIDProof = false
22
+ await req . session . save ( )
23
+ } else {
24
+ throw new Unauthorized ( 'Unauthorized' )
25
+ }
19
26
}
20
27
} catch ( e ) {
21
28
next ( e )
You can’t perform that action at this time.
0 commit comments