Skip to content

lib/authOptions.ts returns true for every OAuth sign-in without persistence #67

Description

@mercy60

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

Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave programarea:frontendImported from ISSUES.mdauthImported from ISSUES.mdpriority:highImported from ISSUES.md

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions