5/12 INVALID AUTHENTICITY TOKEN in user control create

rails
authentication

#1

<PLEASE USE THE FOLLOWING TEMPLATE TO HELP YOU CREATE A GREAT POST!>

<Below this line, add a link to the EXACT exercise that you are stuck at.>
https://www.codecademy.com/courses/rails-auth/lessons/authentication/exercises/authentication-signup-ii?action=lesson_resume
<In what way does your code behave incorrectly? Include ALL error messages.>
I have gone through this many times. I have tried the null_session approach as read in some of the discussions, which let me go on, but still does not work correctly. I have went through the program and used the get code on every task and still end up with the INVALID AUTHENTICITY TOKEN on lesson 5/12. I have restarted it many times and continue to get the same error.


#2

Hi @hammer03,

What does your application_controller.rb file look like? When I switch to :null_session, it works for me. Could you have typed something wrong?

class ApplicationController < ActionController::Base
  # Prevent CSRF attacks by raising an exception.
  # For APIs, you may want to use :null_session instead.
  protect_from_forgery with: :null_session

  ...
end

#3

Maybe, I have tried the null_session and it lets me pass the task, but then throws me an error later when I try to list all users. I will try again, thanks. Lol, I have ben through it over and over again, but I am determined to figure it out.


#4

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.