waiting-for-dev / devise-jwt

JWT token authentication with devise and rails
MIT License
1.25k stars 129 forks source link

Allow JWT key configuration. #241

Closed MichaelCordingley closed 2 years ago

MichaelCordingley commented 2 years ago

Introduces a new method to define what key should be included into the JWT as a subject. This enables using secondary keys to keep primary keys private to their services.

MichaelCordingley commented 2 years ago

This also fixes the case when primary_key is not :id.

waiting-for-dev commented 2 years ago

It makes sense, but it seems specs are failing.

MichaelCordingley commented 2 years ago

The failures are strange. The tests are unable to access the method, but this is a fairly standard and boring way of referencing a class method. It feels like I'm missing something obvious about the identity of self or how pieces mix together, but no permutation of including this gets the tests to pass. I'm at a loss and am open to suggestions.

waiting-for-dev commented 2 years ago

Closing it as it became stale. Feel free to re-take the work if needed. Thanks again for your collaboration.