Skip to content

Commit 789c68f

Browse files
committed
fix(plugin-auth): the account lookup for a refused sign-in carries the declared engine query type
Claude-Session: https://claude.ai/code/session_01KqkTQNLcxVc588eZpJmp1r Co-authored-by: Claude <noreply@anthropic.com>
1 parent dce1c8e commit 789c68f

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

‎packages/plugins/plugin-auth/src/auth-manager.ts‎

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ import {
5353
} from '@objectstack/core';
5454
import type { AuthGate } from '@objectstack/core';
5555
import type { ExecutionContext } from '@objectstack/spec/kernel';
56+
import type { EngineQueryOptions } from '@objectstack/spec/data';
5657
import type {
5758
ApiKeyLifecyclePolicy,
5859
IEmailService,
@@ -9393,10 +9394,12 @@ export class AuthManager {
93939394
const engine = this.getDataEngine();
93949395
if (!engine) return undefined;
93959396
try {
9396-
const SYSTEM_CTX = { isSystem: true, positions: [], permissions: [] };
9397-
const u = await engine.findOne('sys_user', {
9398-
where: { email: email.toLowerCase() }, fields: ['id'], context: SYSTEM_CTX,
9399-
} as any);
9397+
const query: EngineQueryOptions = {
9398+
where: { email: email.toLowerCase() },
9399+
fields: ['id'],
9400+
context: { isSystem: true, positions: [], permissions: [] },
9401+
};
9402+
const u = await engine.findOne('sys_user', query);
94009403
return typeof u?.id === 'string' && u.id ? u.id : undefined;
94019404
} catch (e) {
94029405
// The refusal stands either way; what is lost is its ledger row.

0 commit comments

Comments
 (0)