Ruby
Ruby

Reputation: 21

JWT::DecodeError for sign_out with invalid token with devise-jwt

I am trying to rescue_from a JWT::DecodeError caused by an invalid token when signing out using devise. But it's not working. I keep getting a JWT::DecodeError. Sessions controller:

class SessionsController < Devise::SessionsController

  rescue_from JWT::DecodeError do |exception|
    render json: { response: "Token is invalid!" }, status: :bad_request
  end render
end

Upvotes: 1

Views: 733

Answers (0)

Related Questions