fix(mail): explicit imports for MS-OAuth handlers (createOauthPendingState et al.)
Runtime-Error im /init und /callback weil Nitro auto-import nur server/utils/
scannt, nicht server/db/. Die Helper-Funktionen (createOauthPendingState,
consumeOauthPendingState, upsertOauthMicrosoftConnection, countMailConnections)
sowie ms-oauth-utility-Functions (exchangeCodeForTokens, extractEmailFromId
Token, generate*-Helpers, MS_*-Konstanten) wurden im Code implizit referenziert
aber nicht explizit importiert.
pnpm build:backend hat das nicht gefangen (Nitro Bundle-Step ist toleranter als
strict tsc). Erster Symptom auf staging:
ReferenceError: createOauthPendingState is not defined
at .../routes/api/mail/oauth/microsoft/init.post.mjs:36:3
Fix: explizite import-Statements in beiden Endpoints.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
fc69a14f25
commit
7fb76465f0
@ -1,3 +1,15 @@
|
||||
import {
|
||||
consumeOauthPendingState,
|
||||
countMailConnections,
|
||||
upsertOauthMicrosoftConnection,
|
||||
} from "../../../../db/mail";
|
||||
import { encrypt } from "../../../../utils/crypto";
|
||||
import {
|
||||
exchangeCodeForTokens,
|
||||
extractEmailFromIdToken,
|
||||
MS_OAUTH_SCOPES,
|
||||
} from "../../../../utils/ms-oauth";
|
||||
|
||||
/**
|
||||
* POST /api/mail/oauth/microsoft/callback
|
||||
*
|
||||
|
||||
@ -1,3 +1,13 @@
|
||||
import { createOauthPendingState } from "../../../../db/mail";
|
||||
import {
|
||||
MS_AUTH_BASE,
|
||||
MS_REDIRECT_URI,
|
||||
MS_OAUTH_SCOPES,
|
||||
generateCodeVerifier,
|
||||
computeCodeChallenge,
|
||||
generateStateId,
|
||||
} from "../../../../utils/ms-oauth";
|
||||
|
||||
/**
|
||||
* POST /api/mail/oauth/microsoft/init
|
||||
*
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user