Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When trying to fallback to normal devise authentication, it is showing filter chain halted as authenticate_user_from_token! rendered or redirected. #332

Open
RORingBBK opened this issue Mar 8, 2018 · 0 comments
Labels
support request This issue is a request for support using Simple Token Authentication.

Comments

@RORingBBK
Copy link

RORingBBK commented Mar 8, 2018

I have a RoomsController with following setup:

 module Api
    module V1
      class Api::V1::Member::RoomsController < Member::BaseController
        acts_as_token_authentication_handler_for SpreeUser, fallback: :devise
      
        def create
            # Come here only when authenticated through token.
        end
      end
    end
end

On my ApplicationController I have got the authenticate_spree_user method opened to meet my feature criteria.

def authenticate_spree_user!(opts={})
    if spree_user_signed_in? || request.controller_class == UserSessionsController
      super
    else request.controller_class == Api::V1::Member::RoomsController
      (session[:return_to] = request.fullpath) if request.get?
      redirect_to login_path
  end
end

However I am getting Filter chain halted as :authenticate_spree_user_from_token! rendered or redirected from every request I send to api with failure authentication. Below is the error log:

Redirected to http://sampleapp:3000/login
Filter chain halted as :authenticate_spree_user_from_token! rendered or redirected
Completed 200 OK in 2475ms (ActiveRecord: 0.9ms)

@gonzalo-bulnes gonzalo-bulnes added the support request This issue is a request for support using Simple Token Authentication. label Jan 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
support request This issue is a request for support using Simple Token Authentication.
Projects
None yet
Development

No branches or pull requests

2 participants