Skip to content

Commit 51fdd6d

Browse files
authored
Merge pull request #485 from lenneTech/develop
Release 11.11.1
2 parents a276242 + 12dc155 commit 51fdd6d

File tree

4 files changed

+9
-6
lines changed

4 files changed

+9
-6
lines changed

package-lock.json

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

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@lenne.tech/nest-server",
3-
"version": "11.11.0",
3+
"version": "11.11.1",
44
"description": "Modern, fast, powerful Node.js web framework in TypeScript based on Nest with a GraphQL API and a connection to MongoDB (or other databases).",
55
"keywords": [
66
"node",

spectaql.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ servers:
1111
info:
1212
title: lT Nest Server
1313
description: Modern, fast, powerful Node.js web framework in TypeScript based on Nest with a GraphQL API and a connection to MongoDB (or other databases).
14-
version: 11.11.0
14+
version: 11.11.1
1515
contact:
1616
name: lenne.Tech GmbH
1717
url: https://lenne.tech

src/core/modules/better-auth/core-better-auth-api.middleware.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -244,9 +244,12 @@ export class CoreBetterAuthApiMiddleware implements NestMiddleware {
244244
}
245245
}
246246

247-
// Clean up the used challenge mapping after verification (success or failure)
248-
if (challengeIdToDelete && this.challengeService) {
247+
// Clean up the used challenge mapping only after SUCCESSFUL verification
248+
// On failure, keep the challenge so the user can retry with a different passkey
249+
if (challengeIdToDelete && this.challengeService && response.ok) {
249250
await this.challengeService.deleteChallengeMapping(challengeIdToDelete);
251+
} else if (challengeIdToDelete && !response.ok) {
252+
this.logger.debug(`Keeping challenge mapping after failed verification (status=${response.status}) for retry`);
250253
}
251254

252255
// Convert Web Standard Response to Express response using shared helper

0 commit comments

Comments
 (0)