Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Implementing JWT on Rails

I am having a problem while trying to implement devise jwt. This is my devise user model:

class User < ApplicationRecord  
devise :database_authenticatable, :registerable,
         :recoverable, :rememberable, :validatable,
         :database_authenticatable,
         :jwt_authenticatable,
         jwt_revocation_strategy: JwtBlacklist 
end

And this is my blacklist.rb model.

class JwtBlacklist < ApplicationRecord
include Devise::JWT::RevocationStrategies::Blacklist

self.table_name = 'jwt_blacklist'
end

This is what i am getting.

Caused by:
NameError: uninitialized constant User::JwtBlacklist

Hope you could help me with this I am new on Rails. Thank you so much.

like image 644
Mexa Fireg Avatar asked Oct 28 '25 13:10

Mexa Fireg


1 Answers

Note that include Devise::JWT::RevocationStrategies::Blacklist had been replaced with include Devise::JWT::RevocationStrategies::Denylist according to devise-jwt documentation.

like image 142
jdps Avatar answered Oct 30 '25 07:10

jdps



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!