Skip to content

Commit 639b841

Browse files
committed
fix(clerk-js,shared): Make banned optional
1 parent e6c25a3 commit 639b841

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

packages/clerk-js/src/core/resources/PublicUserData.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export class PublicUserData implements IPublicUserData {
1212
identifier!: string;
1313
userId?: string;
1414
username?: string;
15-
banned!: boolean;
15+
banned?: boolean;
1616

1717
constructor(data: PublicUserDataJSON | PublicUserDataJSONSnapshot) {
1818
this.fromJSON(data);
@@ -27,7 +27,7 @@ export class PublicUserData implements IPublicUserData {
2727
this.identifier = data.identifier || '';
2828
this.userId = data.user_id;
2929
this.username = data.username;
30-
this.banned = data.banned;
30+
this.banned = data.banned ?? undefined;
3131
}
3232

3333
return this;

packages/shared/src/types/json.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ export interface PublicUserDataJSON {
321321
identifier: string;
322322
user_id?: string;
323323
username?: string;
324-
banned: boolean;
324+
banned?: boolean;
325325
}
326326

327327
export interface SessionWithActivitiesJSON extends Omit<SessionJSON, 'user'> {

packages/shared/src/types/session.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,7 @@ export interface PublicUserData {
336336
identifier: string;
337337
userId?: string;
338338
username?: string;
339-
banned: boolean;
339+
banned?: boolean;
340340
}
341341

342342
/**

0 commit comments

Comments
 (0)