ActionController::InvalidAuthenticityToken (Rails Devise gem)

Wajeeh Ahsan
1 min readJan 30, 2020

--

If you’re implementing devise and upon sign_in or sign_up, you got stuck with an error like this:

ActionController::InvalidAuthenticityToken

Just simply got to that controller that’s generating this error, and paste following line of code above all the defined functions:

skip_before_filter :verify_authenticity_token, :only => :create

OR

protect_from_forgery with: :null_session

Hit save and try this route again. Its DONE

--

--

Wajeeh Ahsan
Wajeeh Ahsan

Responses (1)