waiting-for-dev / warden-jwt_auth

JWT token authentication with warden
MIT License
113 stars 56 forks source link

Fix class reload (when cache classes is disabled) #30

Closed sjke closed 3 years ago

sjke commented 4 years ago

Problem: config.mappings [scope] caches its state when the application starts. Description: When we try to check an instance of a class, we will always (after reloading the code) receive false (example: config.mappings [scope].is_a?(User) #=> false)

waiting-for-dev commented 4 years ago

Thanks @sjke for your collaboration, and sorry for the late response.

classify is a method provided by ActiveSupport, so it breaks a warden-jwt_auth setup without it, as you can check in the result for your build: https://travis-ci.org/github/waiting-for-dev/warden-jwt_auth

Ideally, I'd like to fix it from devise-jwt side, as it's a Rails specific problem.

There's a PR there that seems is fixing it, but it's not approved yet as we've to be sure there're no side effects. You can try and if you want help with it:

https://github.com/waiting-for-dev/devise-jwt/pull/186

waiting-for-dev commented 3 years ago

Closing in favor of https://github.com/waiting-for-dev/devise-jwt/pull/186