File tree 2 files changed +12
-5
lines changed
packages/backend/src/services
2 files changed +12
-5
lines changed Original file line number Diff line number Diff line change @@ -14,15 +14,14 @@ class DetailProviderService extends BaseService {
14
14
this . providers_ . push ( fn ) ;
15
15
}
16
16
17
- async get_details ( context ) {
18
- const details = { } ;
17
+ async get_details ( context , out ) {
18
+ out = out || { } ;
19
19
20
20
for ( const provider of this . providers_ ) {
21
- const out = await provider ( context ) ;
22
- Object . assign ( details , out ) ;
21
+ await provider ( context , out ) ;
23
22
}
24
23
25
- return details ;
24
+ return out ;
26
25
}
27
26
}
28
27
Original file line number Diff line number Diff line change @@ -26,6 +26,14 @@ class GetUserService extends BaseService {
26
26
async _init ( ) {
27
27
}
28
28
async get_user ( options ) {
29
+ const user = await this . get_user_ ( options ) ;
30
+ if ( ! user ) return null ;
31
+
32
+ const svc_whoami = this . services . get ( 'whoami' ) ;
33
+ await svc_whoami . get_details ( { user } , user ) ;
34
+ return user ;
35
+ }
36
+ async get_user_ ( options ) {
29
37
const services = this . services ;
30
38
31
39
/** @type BaseDatabaseAccessService */
You can’t perform that action at this time.
0 commit comments