File tree 2 files changed +14
-1
lines changed
2 files changed +14
-1
lines changed Original file line number Diff line number Diff line change 1
1
Changelog
2
2
=========
3
3
4
+ 0.27.1 (????-??-??)
5
+ -------------------
6
+
7
+ * Fix HTTP/500 error when requesting a developer access token.
8
+
9
+
4
10
0.27.0 (2024-12-05)
5
11
-------------------
6
12
Original file line number Diff line number Diff line change @@ -6,10 +6,17 @@ import geoip from 'geoip-lite';
6
6
import { UserLogRecord } from 'knex/types/tables.js' ;
7
7
8
8
export function getLoggerFromContext ( ctx : Context , principal ?: Principal | number ) : UserEventLogger {
9
+
10
+ let principalId ;
11
+ if ( typeof principal === 'number' ) {
12
+ principalId = principal ;
13
+ } else {
14
+ principalId = principal ?. id ?? ctx . session . user ?. id ;
15
+ }
9
16
return ( et : EventType ) => addLogEntry (
10
17
et ,
11
18
ctx . ip ( ) ?? '' ,
12
- principal ?? ctx . session . user ?. id ,
19
+ principalId ,
13
20
ctx . request . headers . get ( 'User-Agent' )
14
21
) ;
15
22
}
You can’t perform that action at this time.
0 commit comments