0

I'm trying to figure out how to display view with token authentication. I want to be able to make screenshot of my app without layout and with token access in http request. I don't want to login user but just access to my views. I use devise devise 3.5.10 and devise-token_authenticatable 0.4.10 with Rails 3. I can access to all the JSON request with my token authentication but can't display views if my user is not already logged in.

jmattheis
  • 10,494
  • 11
  • 46
  • 58

1 Answers1

1

In your ApplicationController you likely have a line like

before_action :authenticate_user!

For the views where you want to allow access even if not logged in, you need to indicate that in the controller

class SpecialController < ApplicationController

  before_action :authenticate_user!, except: [:show] # or whatever actions you choose
SteveTurczyn
  • 36,057
  • 6
  • 41
  • 53