Internal ID: #66
Imported from ISSUES.md via scripts/import-issues.mjs.
Problem Statement. frontend/lib/authOptions.ts:
callbacks: {
async signIn({ user, account, profile }) {
return true;
},
}
There is no adapter, no jwt callback, no session callback. NextAuth.js returns minimal data — and there is no link to the backend JWT.
Expected Outcome. Wire NextAuth ↔ backend: on sign-in callback, exchange OAuth token for backend JWT.
Acceptance Criteria.
- Backend exposes
POST /auth/oauth-callback.
- NextAuth
jwt callback calls it and embeds the backend token.
Implementation Notes.
- Use
signIn event to upsert a user record in Postgres via NextAuth's adapter OR forward to backend.
Files / modules affected.
frontend/lib/authOptions.ts
- New:
frontend/app/api/auth/[...nextauth]/route.ts (NextAuth handler)
backend/src/auth/services/auth.service.ts
Dependencies. None.
Difficulty / Effort. Medium / M (≈ 1 day).
Labels. area:frontend, auth, priority:high
Problem Statement.
frontend/lib/authOptions.ts:There is no
adapter, nojwtcallback, nosessioncallback. NextAuth.js returns minimal data — and there is no link to the backend JWT.Expected Outcome. Wire NextAuth ↔ backend: on sign-in callback, exchange OAuth token for backend JWT.
Acceptance Criteria.
POST /auth/oauth-callback.jwtcallback calls it and embeds the backend token.Implementation Notes.
signInevent to upsert a user record in Postgres via NextAuth's adapter OR forward to backend.Files / modules affected.
frontend/lib/authOptions.tsfrontend/app/api/auth/[...nextauth]/route.ts(NextAuth handler)backend/src/auth/services/auth.service.tsDependencies. None.
Difficulty / Effort. Medium / M (≈ 1 day).
Labels.
area:frontend,auth,priority:high