Closed LoicPoullain closed 2 years ago
Merging #1119 (f912ba5) into v3-0-0 (a16759e) will increase coverage by
0.00%
. The diff coverage is100.00%
.
@@ Coverage Diff @@
## v3-0-0 #1119 +/- ##
=======================================
Coverage 98.82% 98.83%
=======================================
Files 85 86 +1
Lines 1705 1719 +14
Branches 408 413 +5
=======================================
+ Hits 1685 1699 +14
Misses 20 20
Impacted Files | Coverage Δ | |
---|---|---|
packages/core/src/index.ts | 0.00% <ø> (ø) |
|
...kages/core/src/sessions/http/check-user-id-type.ts | 100.00% <100.00%> (ø) |
|
...e/src/sessions/http/get-session-id-from-request.ts | 100.00% <100.00%> (ø) |
|
packages/core/src/sessions/use-sessions.hook.ts | 98.82% <100.00%> (+0.02%) |
:arrow_up: |
packages/core/src/core/config/config.ts | 94.28% <0.00%> (+0.05%) |
:arrow_up: |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact)
,ø = not affected
,? = missing data
Powered by Codecov. Last update a16759e...f912ba5. Read the comment docs.
Issue
See #1120
Solution and steps
userIdType
option and change the interface ofUseSessions
.userIdType
option and change the interface ofJWTxxx
.FetchUser
interface and thefetchUser
functions.Breaking changes and new features
FetchUser
interface and all thefetchUser
functions have been removed.user
option in@JWTxxx
and@UseSessions
now takes by default a(id: number) => Promise<{ [key: string]: any } | null>
by default. If the subject of a JWT (of type string) cannot be converted to a number, then an error is thrown. If the user ID must be a string then adduserIdType: 'string'
to the options.// TODO: do the same with user with permissions.
Checklist