Authenticity Error After Making New User 5/12


#1

I'm getting an error:

ActionController::InvalidAuthenticityToken

after I try to make a new account Ruby on Rails authentication tutorial. Codecademy is allowing me to go to the next lesson, so I'm not sure if my code is correct or not.

The error is in the "Signup II" lesson


#2

I figured out how to solve the problem. I had to delete protect_from_forgery with: :exception in the Application Controller.


#3

worked for me too, but I wonder why?


#4

It seems like the authenticity token isn't working for some reason. Instead of commenting that line out, I just replaced :exception with :null_session as the comment above it suggests.


#5

Thank you! Same problem for me

Go to /app/controllers/application_controller.rb and do :null_session


#6

I ran into the same issue and adding 'protect_from_forgery' in my User controller worked for me (I kept 'protect_from_forgery with: :exception' in the Application controller)