fix: JWT token custom validation
This commit is contained in:
parent
06296e933a
commit
61c3ff54d5
1 changed files with 1 additions and 1 deletions
|
@ -3,7 +3,7 @@ class JwtTokenValidator < ActiveModel::EachValidator
|
|||
begin
|
||||
JWT.decode value, nil, false
|
||||
rescue
|
||||
record.errors[attribute] << (options[:message] || "n'est pas un jeton valide")
|
||||
record.errors.add attribute, :invalid, message: (options[:message] || "n'est pas un jeton valide")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue