0

デバイスはトークン認証のサポートを削除するため、私は現在次の宝石とデバイスを使用しています。 https://github.com/gonzalo-bulnes/simple_token_authentication

ここで欠けているのは、すべての構成設定がhttp://localhost:3000/user/sign_in.json完了しているが、Google で RestConsole Tester を使用してヒットした場合です。

次のエラーが表示されます。

ActionController::InvalidAuthenticityToken at /users/sign_in.json

ActionController::InvalidAuthenticityToken アクションパック (4.0.2)

lib/action_controller/metal/request_forgery_protection.rb、163行目

        def initialize(controller)
          @controller = controller
         end

        def handle_unverified_request
          raise ActionController::InvalidAuthenticityToken
        end
      end
    end

    protected

何か案は?

4

2 に答える 2

2

POST がCSRFトークン チェックに失敗しています。これが機能するはずの which を一時的に削除することで、これが事実であることを確認できprotect_from_forgeryますapplication_controller.rb

この記事では、ログイン リクエストに対して安全な特定のコントローラーのチェックをオーバーライドするためのソリューションを提供します。

于 2014-02-25T16:01:31.090 に答える