From 793c214e6deb41afbc46d4d438243889c53e212e Mon Sep 17 00:00:00 2001 From: dswbx Date: Fri, 7 Nov 2025 09:58:48 +0100 Subject: [PATCH] Merge remote-tracking branch 'origin/release/0.20' into feat/add-otp-plugin --- .vscode/settings.json | 4 ++-- app/src/plugins/auth/email-otp.plugin.ts | 9 ++++++--- biome.json | 2 +- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index 7787afb..6b167a9 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -3,8 +3,8 @@ "biome.enabled": true, "editor.defaultFormatter": "biomejs.biome", "editor.codeActionsOnSave": { - "source.organizeImports.biome": "explicit", - "source.fixAll.biome": "explicit" + //"source.organizeImports.biome": "explicit", + //"source.fixAll.biome": "explicit" }, "typescript.preferences.importModuleSpecifier": "non-relative", "typescript.preferences.autoImportFileExcludePatterns": [ diff --git a/app/src/plugins/auth/email-otp.plugin.ts b/app/src/plugins/auth/email-otp.plugin.ts index 8a97b4c..1c8af01 100644 --- a/app/src/plugins/auth/email-otp.plugin.ts +++ b/app/src/plugins/auth/email-otp.plugin.ts @@ -57,7 +57,7 @@ export type EmailOTPPluginOptions = { * @default false */ showActualErrors?: boolean; - + /** * Allow direct mutations (create/update) of OTP codes outside of this plugin, * e.g. via API or admin UI. If false, mutations are only allowed via the plugin's flows. @@ -293,7 +293,7 @@ async function getValidatedCode( if (otpData.expires_at < new Date()) { throw new OTPError("Code expired"); } - + if (otpData.used_at) { throw new OTPError("Code already used"); } @@ -316,7 +316,10 @@ async function invalidateAllUserCodes(app: App, entityName: string, email: strin function registerListeners(app: App, entityName: string) { app.emgr.onAny( (event) => { - if (event instanceof DatabaseEvents.MutatorInsertBefore || event instanceof DatabaseEvents.MutatorUpdateBefore) { + if ( + event instanceof DatabaseEvents.MutatorInsertBefore || + event instanceof DatabaseEvents.MutatorUpdateBefore + ) { if (event.params.entity.name === entityName) { throw new OTPError("Mutations of the OTP entity are not allowed"); } diff --git a/biome.json b/biome.json index 95ea38a..6e0a520 100644 --- a/biome.json +++ b/biome.json @@ -1,6 +1,6 @@ { "$schema": "https://biomejs.dev/schemas/2.3.3/schema.json", - "assist": { "actions": { "source": { "organizeImports": "on" } } }, + "assist": { "actions": { "source": { "organizeImports": "off" } } }, "vcs": { "defaultBranch": "main" },