0
0

More than 1 year has passed since last update.

CSRFトークンチェックでエラーになった事。

Last updated at Posted at 2022-02-07

先週の行ったことの振り返りとして記述 2022/1/30 〜 2/4 (言語化のための記録)

行ったこと

・Railsでログインユーザーidをデータベースに保存
・BootStrap5の導入のサインアップ画面の調整

躓いた点

・サーバー側、event_controlle.rbの create でuser_idを保存したいが、CSRFトークンチェックでエラーになる。

どのように解決したか

devise_token_authを使いトークン認証を通すことで解決できるが、
今回はskip_before_actionをコントローラーに記述し、エラーをのがれた。

問題点

skip_before_actionだとセキュリティ上好ましくないので、改めて改修する。

0
0
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0