Skip to content

Commit adfd22b

Browse files
committed
Fix: invalid key in User object validation
PasswordLoginUserIdentityType has username, email and id. isValidUserObject() was looking for a 'user' key instead of 'username'
1 parent 1fecbd8 commit adfd22b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/client/src/AccountsClient.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ import { hashPassword } from './encryption';
3131
import type { TransportInterface } from './TransportInterface';
3232
import type { TokenStorage, AccountsClientConfiguration } from './config';
3333

34-
const isValidUserObject = (user: PasswordLoginUserIdentityType) => has(user, 'user') || has(user, 'email') || has(user, 'id');
34+
const isValidUserObject = (user: PasswordLoginUserIdentityType) => has(user, 'username') || has(user, 'email') || has(user, 'id');
3535

3636
const ACCESS_TOKEN = 'accounts:accessToken';
3737
const REFRESH_TOKEN = 'accounts:refreshToken';

0 commit comments

Comments
 (0)