Skip to content

Commit e6306f0

Browse files
committed
feat(types): Update clientTrustState to be optional in ClientResource and related interfaces
1 parent e2fc340 commit e6306f0

File tree

4 files changed

+8
-6
lines changed

4 files changed

+8
-6
lines changed

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export class Client extends BaseResource implements ClientResource {
2727
cookieExpiresAt: Date | null = null;
2828
/** Last authentication strategy used by this client; `null` when unknown/disabled. */
2929
lastAuthenticationStrategy: LastAuthenticationStrategy | null = null;
30-
clientTrustState: ClientTrustState | null = null;
30+
clientTrustState?: ClientTrustState | undefined = undefined;
3131
createdAt: Date | null = null;
3232
updatedAt: Date | null = null;
3333

@@ -88,7 +88,7 @@ export class Client extends BaseResource implements ClientResource {
8888
this.signIn = new SignIn(null);
8989
this.lastActiveSessionId = null;
9090
this.lastAuthenticationStrategy = null;
91-
this.clientTrustState = null;
91+
this.clientTrustState = undefined;
9292
this.cookieExpiresAt = null;
9393
this.createdAt = null;
9494
this.updatedAt = null;
@@ -138,7 +138,7 @@ export class Client extends BaseResource implements ClientResource {
138138
this.captchaBypass = data.captcha_bypass || false;
139139
this.cookieExpiresAt = data.cookie_expires_at ? unixEpochToDate(data.cookie_expires_at) : null;
140140
this.lastAuthenticationStrategy = data.last_authentication_strategy || null;
141-
this.clientTrustState = data.client_trust_state || null;
141+
this.clientTrustState = data.client_trust_state;
142142
this.createdAt = unixEpochToDate(data.created_at || undefined);
143143
this.updatedAt = unixEpochToDate(data.updated_at || undefined);
144144
}
@@ -157,7 +157,7 @@ export class Client extends BaseResource implements ClientResource {
157157
captcha_bypass: this.captchaBypass,
158158
cookie_expires_at: this.cookieExpiresAt ? this.cookieExpiresAt.getTime() : null,
159159
last_authentication_strategy: this.lastAuthenticationStrategy ?? null,
160-
client_trust_state: this.clientTrustState ?? null,
160+
...(this.clientTrustState && { client_trust_state: this.clientTrustState }),
161161
created_at: this.createdAt?.getTime() ?? null,
162162
updated_at: this.updatedAt?.getTime() ?? null,
163163
};

packages/expo/src/hooks/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ export {
1111
useReverification,
1212
} from '@clerk/clerk-react';
1313

14+
export * from './useSignInWithApple';
15+
export * from './useSignInWithGoogle';
1416
export * from './useSSO';
1517
export * from './useOAuth';
1618
export * from './useAuth';

packages/types/src/client.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export interface ClientResource extends ClerkResource {
2020
lastActiveSessionId: string | null;
2121
/** Last authentication strategy used by this client; `null` when unknown or feature disabled. */
2222
lastAuthenticationStrategy: LastAuthenticationStrategy | null;
23-
clientTrustState: ClientTrustState | null;
23+
clientTrustState?: ClientTrustState;
2424
captchaBypass: boolean;
2525
cookieExpiresAt: Date | null;
2626
createdAt: Date | null;

packages/types/src/json.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ export interface ClientJSON extends ClerkResourceJSON {
113113
captcha_bypass?: boolean; // this is used by the @clerk/testing package
114114
last_active_session_id: string | null;
115115
last_authentication_strategy: LastAuthenticationStrategy | null;
116-
client_trust_state: ClientTrustState | null;
116+
client_trust_state?: ClientTrustState;
117117
cookie_expires_at: number | null;
118118
created_at: number;
119119
updated_at: number;

0 commit comments

Comments
 (0)