File tree 1 file changed +12
-0
lines changed
1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -26,6 +26,10 @@ export class User extends PassageBase {
26
26
* @return {Promise<UserInfo> } Passage User object
27
27
*/
28
28
public async get ( externalId : string ) : Promise < PassageUser > {
29
+ if ( ! externalId ) {
30
+ throw new Error ( 'externalId is required.' ) ;
31
+ }
32
+
29
33
try {
30
34
const response = await this . userClient . listPaginatedUsers ( {
31
35
appId : this . config . appId ,
@@ -53,6 +57,10 @@ export class User extends PassageBase {
53
57
* @return {Promise<WebAuthnDevices[]> } List of devices
54
58
*/
55
59
public async listDevices ( externalId : string ) : Promise < WebAuthnDevices [ ] > {
60
+ if ( ! externalId ) {
61
+ throw new Error ( 'externalId is required.' ) ;
62
+ }
63
+
56
64
try {
57
65
const user = await this . get ( externalId ) ;
58
66
const response = await this . deviceClient . listUserDevices ( {
@@ -92,6 +100,10 @@ export class User extends PassageBase {
92
100
* @return {Promise<UserInfo> } Passage User object
93
101
*/
94
102
private async getUserById ( userId : string ) : Promise < PassageUser > {
103
+ if ( ! userId ) {
104
+ throw new Error ( 'userId is required.' ) ;
105
+ }
106
+
95
107
const response = await this . userClient . getUser ( {
96
108
appId : this . config . appId ,
97
109
userId : userId ,
You can’t perform that action at this time.
0 commit comments