Skip to content

Commit

Permalink
type fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
niftyvictor committed Feb 6, 2025
1 parent 1dcb7e5 commit 7c5e3c8
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 15 deletions.
4 changes: 2 additions & 2 deletions lib/build/recipe/webauthn/api/implementation.js
Original file line number Diff line number Diff line change
Expand Up @@ -718,7 +718,7 @@ function getAPIImplementation() {
}
async function doRegisterCredentialAndVerifyEmailAndTryLinkIfNotPrimary(recipeUserId) {
let updateResponse = await options.recipeImplementation.registerCredential({
recipeUserId,
recipeUserId: recipeUserId.getAsString(),
webauthnGeneratedOptionsId,
credential,
userContext,
Expand Down Expand Up @@ -953,7 +953,7 @@ function getAPIImplementation() {
webauthnGeneratedOptionsId,
credential,
userContext,
recipeUserId: session.getRecipeUserId(),
recipeUserId: session.getRecipeUserId().getAsString(),
});
if (registerCredentialResponse.status !== "OK") {
return authUtils_1.AuthUtils.getErrorStatusResponseWithReason(
Expand Down
2 changes: 1 addition & 1 deletion lib/build/recipe/webauthn/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ export default class Wrapper {
credential,
userContext,
}: {
recipeUserId: RecipeUserId;
recipeUserId: string;
webauthnGeneratedOptionsId: string;
credential: CredentialPayload;
userContext?: Record<string, any>;
Expand Down
3 changes: 1 addition & 2 deletions lib/build/recipe/webauthn/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
exports.getGeneratedOptions = exports.sendEmail = exports.sendRecoverAccountEmail = exports.createRecoverAccountLink = exports.registerCredential = exports.consumeRecoverAccountToken = exports.recoverAccount = exports.generateRecoverAccountToken = exports.verifyCredentials = exports.signIn = exports.signInOptions = exports.registerOptions = exports.Error = exports.init = void 0;
const recipe_1 = __importDefault(require("./recipe"));
const error_1 = __importDefault(require("./error"));
const recipeUserId_1 = __importDefault(require("../../recipeUserId"));
const constants_1 = require("../multitenancy/constants");
const utils_1 = require("./utils");
const __1 = require("../..");
Expand Down Expand Up @@ -271,7 +270,7 @@ class Wrapper {
return consumeResp;
}
let result = await Wrapper.registerCredential({
recipeUserId: new recipeUserId_1.default(consumeResp.userId),
recipeUserId: consumeResp.userId,
webauthnGeneratedOptionsId,
credential,
userContext,
Expand Down
8 changes: 1 addition & 7 deletions lib/build/recipe/webauthn/recipeImplementation.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,16 +68,10 @@ function getRecipeInterface(querier, getWebauthnConfig) {
}
const user = result.user;
// todo this might be wrong but will have to figure out - what happens when there are multiple webauthn login methods ?
const parsedEmail =
email =
(_b = user.loginMethods.find((lm) => lm.recipeId === "webauthn")) === null || _b === void 0
? void 0
: _b.email;
if (!parsedEmail) {
return {
status: "RECOVER_ACCOUNT_TOKEN_INVALID_ERROR",
};
}
email = parsedEmail;
}
if (!email) {
return {
Expand Down
2 changes: 1 addition & 1 deletion lib/build/recipe/webauthn/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ export declare type RecipeInterface = {
webauthnGeneratedOptionsId: string;
credential: RegistrationPayload;
userContext: UserContext;
recipeUserId: RecipeUserId;
recipeUserId: string;
}): Promise<
| {
status: "OK";
Expand Down
4 changes: 2 additions & 2 deletions lib/ts/recipe/webauthn/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,7 @@ export default class Wrapper {
}

let result = await Wrapper.registerCredential({
recipeUserId: new RecipeUserId(consumeResp.userId),
recipeUserId: consumeResp.userId,
webauthnGeneratedOptionsId,
credential,
userContext,
Expand Down Expand Up @@ -471,7 +471,7 @@ export default class Wrapper {
credential,
userContext,
}: {
recipeUserId: RecipeUserId;
recipeUserId: string;
webauthnGeneratedOptionsId: string;
credential: CredentialPayload;
userContext?: Record<string, any>;
Expand Down

0 comments on commit 7c5e3c8

Please sign in to comment.