Skip to content

Conversation

@samironbarai
Copy link

This PR updates the config/config.php file to ensure certain configuration values read from .env are properly typed.

Changes include:

  • Cast numeric values to (int):

    • ttl
    • refresh_ttl
    • leeway
  • Cast boolean value to (bool):

    • blacklist_enabled

Reasoning:

Values returned from env() are strings by default. Explicit casting ensures these configuration values are handled correctly by the package, preventing subtle bugs caused by string values in numeric or boolean contexts.

Impact:

  • No breaking changes; defaults remain the same.
  • Improves robustness and type safety for JWT configuration.

Testing:

  • Verified locally that ttl, refresh_ttl, leeway return integers, and blacklist_enabled returns a boolean.
  • Package behavior remains unchanged.

- Cast 'ttl', 'refresh_ttl', 'leeway' to int to ensure numeric behavior
- Cast 'blacklist_enabled' to bool for proper boolean handling
- Improves robustness and prevents subtle bugs from string values in .env
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