Skip to content

Commit 2c3e7ab

Browse files
committed
change middleware file location
1 parent 7540c5d commit 2c3e7ab

File tree

3 files changed

+2
-2
lines changed

3 files changed

+2
-2
lines changed

docs/Authentication.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ In addition to the GCIP ID token for IAP, SSR API calls also propagate a compact
101101

102102
- The `md_session` cookie's JWT is reused as this user‑context token.
103103
- On the server, [src/app/utils/auth-server.ts](src/app/utils/auth-server.ts) reads the cookie via `getUserContextJwtFromCookie()`.
104-
- [src/app/context/api-auth-middleware.ts](src/app/context/api-auth-middleware.ts) provides `generateAuthMiddlewareWithToken(accessToken, userContextJwt?)`, which:
104+
- [src/app/services/api-auth-middleware.ts](src/app/services/api-auth-middleware.ts) provides `generateAuthMiddlewareWithToken(accessToken, userContextJwt?)`, which:
105105
- Sets `Authorization: Bearer <accessToken>` for IAP.
106106
- When `userContextJwt` is present, also sets `x-mdb-user-context: <userContextJwt>`.
107107
- All server‑side feeds service functions in [src/app/services/feeds/index.ts](src/app/services/feeds/index.ts) accept an optional `userContextJwt` and pass it into this middleware.

src/app/services/feeds/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import type { paths } from './types';
33
import { type AllFeedsParams, type AllFeedType } from './utils';
44
import { type GtfsRoute } from '../../types';
55
import { getFeedFilesBaseUrl } from '../../utils/config';
6-
import { generateAuthMiddlewareWithToken } from '../../context/api-auth-middleware';
6+
import { generateAuthMiddlewareWithToken } from '../api-auth-middleware';
77

88
const client = createClient<paths>({
99
baseUrl: String(process.env.NEXT_PUBLIC_FEED_API_BASE_URL),

0 commit comments

Comments
 (0)