Skip to content

Commit e488ea6

Browse files
authored
Add passkey authentication events (#1392)
## Description A bug in our API prevented these from being returned but also we are missing them from the types in this library. The API bug has been fixed and this fixes the SDK. ## Documentation Does this require changes to the WorkOS Docs? E.g. the [API Reference](https://workos.com/docs/reference) or code snippets need updates. ``` [ ] Yes ``` If yes, link a related docs PR and add a docs maintainer as a reviewer. Their approval is required.
1 parent 9ba9795 commit e488ea6

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed

src/common/interfaces/event.interface.ts

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,28 @@ export interface AuthenticationOAuthSucceededEventResponse
121121
data: AuthenticationEventResponse;
122122
}
123123

124+
export interface AuthenticationPasskeyFailedEvent extends EventBase {
125+
event: 'authentication.passkey_failed';
126+
data: AuthenticationEvent;
127+
}
128+
129+
export interface AuthenticationPasskeyFailedEventResponse
130+
extends EventResponseBase {
131+
event: 'authentication.passkey_failed';
132+
data: AuthenticationEventResponse;
133+
}
134+
135+
export interface AuthenticationPasskeySucceededEvent extends EventBase {
136+
event: 'authentication.passkey_succeeded';
137+
data: AuthenticationEvent;
138+
}
139+
140+
export interface AuthenticationPasskeySucceededEventResponse
141+
extends EventResponseBase {
142+
event: 'authentication.passkey_succeeded';
143+
data: AuthenticationEventResponse;
144+
}
145+
124146
export interface AuthenticationPasswordFailedEvent extends EventBase {
125147
event: 'authentication.password_failed';
126148
data: AuthenticationEvent;
@@ -640,6 +662,8 @@ export type Event =
640662
| AuthenticationOAuthSucceededEvent
641663
| AuthenticationSSOFailedEvent
642664
| AuthenticationSSOSucceededEvent
665+
| AuthenticationPasskeyFailedEvent
666+
| AuthenticationPasskeySucceededEvent
643667
| AuthenticationPasswordFailedEvent
644668
| AuthenticationPasswordSucceededEvent
645669
| AuthenticationMagicAuthFailedEvent
@@ -695,6 +719,8 @@ export type EventResponse =
695719
| AuthenticationMfaSucceededEventResponse
696720
| AuthenticationOAuthFailedEventResponse
697721
| AuthenticationOAuthSucceededEventResponse
722+
| AuthenticationPasskeyFailedEventResponse
723+
| AuthenticationPasskeySucceededEventResponse
698724
| AuthenticationPasswordFailedEventResponse
699725
| AuthenticationPasswordSucceededEventResponse
700726
| AuthenticationSSOFailedEventResponse

src/common/serializers/event.serializer.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ export const deserializeEvent = (event: EventResponse): Event => {
3636
case 'authentication.mfa_succeeded':
3737
case 'authentication.oauth_failed':
3838
case 'authentication.oauth_succeeded':
39+
case 'authentication.passkey_failed':
40+
case 'authentication.passkey_succeeded':
3941
case 'authentication.password_failed':
4042
case 'authentication.password_succeeded':
4143
case 'authentication.sso_failed':

0 commit comments

Comments
 (0)