Closed mein-beer-hu closed 1 year ago
Your configuration seems correct in that regard, make sure devise is well set up for an API: https://github.com/waiting-for-dev/devise-jwt/wiki/Configuring-devise-for-APIs
One more difference from there is
devise_for :users, controllers: {
confirmations: :user_confirmations,
passwords: :passwords,
invitations: :invitations,
}
devise_scope :user do
post 'login' => 'api/people/sessions#create', :as => :login
delete 'logout' => 'api/people/sessions#destroy', :as => :logout
# post 'register' => 'api/people/registrations#create', :as => :registers
delete 'delete_account' => 'api/people/registrations#destroy', :as => :delete_account
end
This is how my routes look like. Maybe I should add { defaults: :json }
Did you go through all the guides I linked before? One common issue is overriding controllers beyond making them recognizable by Devise.
Yes, I think I also observed that its only the logout
path thats partially failing when invoked without .json
. For rest of the controllers, with/without json in URL is not causing any issues
Closing it, as I don't think there's anything we can fix on our end. Please, feel free to get back if you have any new information.
Hello, I am using devise + devise_jwt I am having trouble understanding the right way to support both the formats in url. I did read through the section of "supporting
request_formats
here: https://github.com/waiting-for-dev/devise-jwt#request_formatsI have the following setup in my
devise.rb
(initializer folder)Expected behavior
Support
.json
in url as well as no formatsActual behavior
I am going to pick one URL to help keep this scoped:
When I hit
logout.json
here is what happens:Please observe there is no updates to
jwt_denylist
table.Now, if I try
logout
(no.json
in url)It properly updates the
jwt_denylist
Debugging information
Provide following information. Please, format pasted output as code. Feel free to remove the secret key value.
Version of
devise-jwt
in use :0.9.0
Version of
rails
in use:6.1
Version of
warden-jwt_auth
in useOutput of
Devise::JWT.config
Output of
Warden::JWTAuth.config
Output of
Devise.mappings
If your issue is related with not getting a JWT from the server:
If your issue is related with not being able to revoke a JWT: