fix: logout on legacy browsers not working with antibrute plugin

Massimo Melina committed Oct 19, 2025 at 20:31 UTC 6670c10960b0485f69227a7fba6817aab274fc31
1 file changed +1
src/auth.ts
+1
@@ -39,6 +39,7 @@ export function getCurrentUsername(ctx: Context): string {
39 }
40
41 export async function clearTextLogin(ctx: Context, u: string, p: string, via: string) {
42 + if (!p) return
43 if ((await events.emitAsync('attemptingLogin', { ctx, username: u, via }))?.isDefaultPrevented()) return
44 const plugins = await events.emitAsync('clearTextLogin', { ctx, username: u, password: p, via }) // provide clear password to plugins
45 const a = plugins?.some(x => x === true) ? getAccount(u) : await srpCheck(u, p)