rails/app/controllers/application_controller.rb
# Prevent CSRF attacks by raising an exception.
# For APIs, you may want to use :null_session instead.
Prevent CSRF attacks by raising an exception.
For APIs, you may want to use :null_session instead.
Prevent CSRF attacks by raising an exception . For APIs you may want to use : null_session instead .
def authenticate_user_from_token!
    authenticate_with_http_token do |token, options|
      user_email = options[:email].presence
      user = user_email && User.find_by_email(user_email)
      if user && Devise.secure_compare(user.authentication_token, token)
        sign_in user, store: false
      end
    end
  end
def authenticate_user_from_token! authenticate_with_http_token do | token , options | user_email = options [ :email ] . presence user = user_email && User . find_by_email ( user_email ) if user && Devise . secure_compare ( user . authentication_token , token ) sign_in user , store : false end end end
Prevent CSRF attacks by raising an exception.
Prevent CSRF attacks by raising an exception .