Skip to content

Commit 24d0742

Browse files
authored
feat(backend,clerk-expo): Add last authenitcation strategy (#6748)
1 parent acc7699 commit 24d0742

File tree

5 files changed

+20
-1
lines changed

5 files changed

+20
-1
lines changed

.changeset/honest-banks-happen.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@clerk/backend': minor
3+
---
4+
5+
Add lastAuthenticationStrategy to API resources

.changeset/warm-loops-roll.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@clerk/clerk-expo': patch
3+
---
4+
5+
Add last_authentication_strategy to dummy cache data

packages/backend/src/api/resources/Client.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import type { LastAuthenticationStrategy } from '@clerk/types';
2+
13
import type { ClientJSON } from './JSON';
24
import { Session } from './Session';
35

@@ -30,6 +32,10 @@ export class Client {
3032
* The ID of the last active [Session](https://clerk.com/docs/references/backend/types/backend-session).
3133
*/
3234
readonly lastActiveSessionId: string | null,
35+
/**
36+
* The last authentication strategy used by the `Client`.
37+
*/
38+
readonly lastAuthenticationStrategy: LastAuthenticationStrategy | null,
3339
/**
3440
* The date when the `Client` was first created.
3541
*/
@@ -48,6 +54,7 @@ export class Client {
4854
data.sign_in_id,
4955
data.sign_up_id,
5056
data.last_active_session_id,
57+
data.last_authentication_strategy,
5158
data.created_at,
5259
data.updated_at,
5360
);

packages/backend/src/api/resources/JSON.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { SignUpStatus, VerificationStatus } from '@clerk/types';
1+
import type { LastAuthenticationStrategy, SignUpStatus, VerificationStatus } from '@clerk/types';
22

33
import type {
44
ActorTokenStatus,
@@ -142,6 +142,7 @@ export interface ClientJSON extends ClerkResourceJSON {
142142
sign_in_id: string | null;
143143
sign_up_id: string | null;
144144
last_active_session_id: string | null;
145+
last_authentication_strategy: LastAuthenticationStrategy | null;
145146
created_at: number;
146147
updated_at: number;
147148
}

packages/expo/src/cache/dummy-data/client-resource.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@ export const DUMMY_CLERK_CLIENT_RESOURCE = {
125125
},
126126
last_active_session_id: null,
127127
cookie_expires_at: null,
128+
last_authentication_strategy: null,
128129
created_at: new Date().getTime(),
129130
updated_at: new Date().getTime(),
130131
} as unknown as ClientJSONSnapshot;

0 commit comments

Comments
 (0)