Sha256: 66504676e7165e4e1c0a4cc7399a29f50ebe3d3d2614d0bf739a88e5a975d6a8
Contents?: true
Size: 878 Bytes
Versions: 5
Compression:
Stored size: 878 Bytes
Contents
# frozen_string_literal: true require 'active_support/concern' module Devise module JWT module RevocationStrategies # This strategy must be included in an ActiveRecord model, and requires # that it has a `jti` column. # # In order to tell whether a token is revoked, it just checks whether # `jti` is in the table. On revocation, creates a new record with it. module Blacklist extend ActiveSupport::Concern included do # @see Warden::JWTAuth::Interfaces::RevocationStrategy#jwt_revoked? def self.jwt_revoked?(payload, _user) exists?(jti: payload['jti']) end # @see Warden::JWTAuth::Interfaces::RevocationStrategy#revoke_jwt def self.revoke_jwt(payload, _user) create(jti: payload['jti']) end end end end end end
Version data entries
5 entries across 5 versions & 1 rubygems