Skip to content

Commit 57606db

Browse files
committed
Allow customizing the entityIdField and responseEntityField
1 parent ec2ab69 commit 57606db

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

src/auth-module/auth-module.state.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,17 @@ eslint
33
@typescript-eslint/explicit-function-return-type: 0,
44
@typescript-eslint/no-explicit-any: 0
55
*/
6-
export default function setupAuthState({ userService, serverAlias }) {
6+
export default function setupAuthState({
7+
userService,
8+
serverAlias,
9+
responseEntityField = 'user',
10+
entityIdField = 'userId'
11+
}) {
712
const state = {
813
accessToken: null, // The JWT
914
payload: null, // The JWT payload
10-
entityIdField: 'userId',
11-
responseEntityField: 'user',
15+
entityIdField,
16+
responseEntityField,
1217

1318
isAuthenticatePending: false,
1419
isLogoutPending: false,

0 commit comments

Comments
 (0)