Skip to content

API Crashes With 500 When JWT Auth Is Enabled #14

@Iamsdt

Description

@Iamsdt

After enabling JWT authentication in the configuration:

{
  "agent": "graph.react:app",
  "env": ".env",
  "auth": "jwt"
}

the API immediately fails on startup. Any request causes the server to crash with a 500 Internal Server Error. The application works normally when JWT is disabled.

Expected behavior
The API should start successfully and handle authenticated requests without crashing.

Actual behavior

  • Server fails to start properly, or
  • Any API call results in a 500 error
  • Logs indicate a crash related to JWT initialization or middleware execution.

Steps to reproduce

  1. Update configuration to use "auth": "jwt".
  2. Start the server.
  3. Hit any endpoint (even public ones).

Relevant logs / stack traces
(Add logs here if available)

Environment

  • Agent: graph.react:app
  • Auth: jwt
  • Config file: .env
  • Runtime: (Node version / framework version)

Additional context
The failure appears as soon as JWT is enabled, suggesting an initialization or configuration handling bug.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions