Skip to content

Conversation

@mgreen216
Copy link

Summary

This PR fixes the critical authentication issue that was causing all API calls to fail with 401 Unauthorized.

The Problem

  • authOptions is a function that requires the request parameter
  • All API endpoints were calling it as authOptions instead of authOptions(req)
  • This caused all authenticated endpoints to return 401 errors
  • Users could not see Claude/Mistral models even when signed in

The Solution

  1. Fixed authOptions calls in API endpoints:

    • pages/api/requestOp.ts - Now calls authOptions(req)
    • pages/api/direct/models.ts - Now calls authOptions(req)
  2. Added temporary mock responses for models endpoint:

    • Includes Claude 3.5 Sonnet, Claude 3 Sonnet, Claude 3 Haiku
    • Includes Mistral Large
    • Includes GPT-3.5, GPT-4, Gemini models
    • Sets Claude 3.5 Sonnet as default model

Files Changed

  • pages/api/requestOp.ts - Fixed authentication, added mock responses
  • pages/api/direct/models.ts - Fixed authentication

Testing

  1. Sign in to the application
  2. Check that API calls no longer return 401
  3. Verify Claude 3.5 Sonnet appears in the model dropdown
  4. Verify you can select and use different models

Security Note

This is a clean PR with no hardcoded secrets or credentials. The previous PR was closed due to accidental inclusion of build scripts containing secrets.

- Fix authOptions call in requestOp.ts and models.ts (needs request parameter)
- Add temporary mock responses for models endpoint
- Include Claude and Mistral models in mock response
- No hardcoded secrets or credentials

This fixes the critical issue where all authenticated API calls were failing.
Copy link
Author

@mgreen216 mgreen216 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@juleswhite @karelyrodri This PR fixes an authentication issue that's preventing users from accessing Claude and Mistral models. All authenticated API calls are currently failing with 401 errors.

@mgreen216 mgreen216 marked this pull request as draft October 1, 2025 21:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant