Skip to content

Commit 76fca4e

Browse files
authored
Merge pull request #1018 from supertokens/fix/webauthn-missing-credential-register-endpoint
fix: Add missing credential register endpoint for WebAuthn recipe
2 parents 57ec834 + 5396dbf commit 76fca4e

File tree

7 files changed

+30
-2
lines changed

7 files changed

+30
-2
lines changed

CHANGELOG.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## Unreleased
99

10+
- Added register credential endpoint for the WebAuthn recipe
11+
1012
## [23.0.0] - 2025-06-27
1113

1214
- The `getConsentRequest`, `acceptConsentRequest`, `rejectConsentRequest`, `acceptLoginRequest`, `rejectLoginRequest` and `introspectToken` can now possibly return an `ErrorOAuth2`.
@@ -970,7 +972,7 @@ Session.init({
970972
input.userId,
971973
input.recipeUserId,
972974
input.tenantId,
973-
input.userContext
975+
input.userContext,
974976
)),
975977
};
976978

@@ -998,7 +1000,7 @@ Session.init({
9981000
input.recipeUserId,
9991001
input.tenantId,
10001002
input.accessTokenPayload,
1001-
input.userContext
1003+
input.userContext,
10021004
)),
10031005
};
10041006

lib/build/recipe/webauthn/constants.d.ts

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/build/recipe/webauthn/constants.js

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/build/recipe/webauthn/recipe.js

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/ts/core/versions/5.3/schema.d.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
// @ts-nocheck
55
// @ts-nocheck
66
// @ts-nocheck
7+
// @ts-nocheck
8+
// @ts-nocheck
79
/**
810
* This file was auto-generated by openapi-typescript.
911
* Do not make direct changes to the file.

lib/ts/recipe/webauthn/constants.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ export const RECOVER_ACCOUNT_API = "/user/webauthn/reset";
2727

2828
export const SIGNUP_EMAIL_EXISTS_API = "/webauthn/email/exists";
2929

30+
export const REGISTER_CREDENTIAL_API = "/webauthn/credential";
31+
3032
// 60 seconds (60 * 1000ms)
3133
export const DEFAULT_REGISTER_OPTIONS_TIMEOUT = 60000;
3234
export const DEFAULT_REGISTER_OPTIONS_ATTESTATION = "none";

lib/ts/recipe/webauthn/recipe.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ import {
2727
GENERATE_RECOVER_ACCOUNT_TOKEN_API,
2828
RECOVER_ACCOUNT_API,
2929
SIGNUP_EMAIL_EXISTS_API,
30+
REGISTER_CREDENTIAL_API,
3031
} from "./constants";
3132
import signUpAPI from "./api/signup";
3233
import signInAPI from "./api/signin";
@@ -35,6 +36,7 @@ import signInOptionsAPI from "./api/signInOptions";
3536
import generateRecoverAccountTokenAPI from "./api/generateRecoverAccountToken";
3637
import recoverAccountAPI from "./api/recoverAccount";
3738
import emailExistsAPI from "./api/emailExists";
39+
import registerCredentialAPI from "./api/registerCredential";
3840
import { isTestEnv } from "../../utils";
3941
import RecipeImplementation from "./recipeImplementation";
4042
import APIImplementation from "./api/implementation";
@@ -295,6 +297,12 @@ export default class Recipe extends RecipeModule {
295297
id: SIGNUP_EMAIL_EXISTS_API,
296298
disabled: this.apiImpl.emailExistsGET === undefined,
297299
},
300+
{
301+
method: "post",
302+
pathWithoutApiBasePath: new NormalisedURLPath(REGISTER_CREDENTIAL_API),
303+
id: REGISTER_CREDENTIAL_API,
304+
disabled: this.apiImpl.registerCredentialPOST === undefined,
305+
},
298306
];
299307
};
300308

@@ -332,6 +340,8 @@ export default class Recipe extends RecipeModule {
332340
return await recoverAccountAPI(this.apiImpl, tenantId, options, userContext);
333341
} else if (id === SIGNUP_EMAIL_EXISTS_API) {
334342
return await emailExistsAPI(this.apiImpl, tenantId, options, userContext);
343+
} else if (id === REGISTER_CREDENTIAL_API) {
344+
return await registerCredentialAPI(this.apiImpl, tenantId, options, userContext);
335345
} else return false;
336346
};
337347

0 commit comments

Comments
 (0)