###前提
作成途中まではこまめにログインができていたのですが
いきなりログインができなくなりました
発生している問題・エラーメッセージ
ruby on rails で devaise を用いてログイン画面を作っているのですが、ログインした後再度ログイン画面にredirectしてしまいます。
該当のソースコード
rails
1Started POST "/users/sign_in" for 210.1.146.36 at 2022-07-23 11:42:12 +0000 2Cannot render console from 210.1.146.36! Allowed networks: 127.0.0.0/127.255.255.255, ::1 3Processing by Devise::SessionsController#create as HTML 4 Parameters: {"authenticity_token"=>"[……]", "user"=>{"email"=>"……", "password"=>"[……]", "remember_me"=>"0"}, "commit"=>"Log in"} 5 User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."email" = ? ORDER BY "users"."id" ASC LIMIT ? [["email", "………"], ["LIMIT", 1]] 6Completed 401 Unauthorized in 9ms (ActiveRecord: 0.2ms | Allocations: 2058) 7 8 9Processing by Devise::SessionsController#new as HTML 10 Parameters: {"authenticity_token"=>"[……]", "user"=>{"email"=>"……", "password"=>"[……]", "remember_me"=>"0"}, "commit"=>"Log in"} 11 Rendering layout layouts/application.html.erb 12 Rendering devise/sessions/new.html.erb within layouts/application 13 Rendered devise/shared/_links.html.erb (Duration: 0.3ms | Allocations: 171) 14 Rendered devise/sessions/new.html.erb within layouts/application (Duration: 4.7ms | Allocations: 1250) 15[Webpacker] Everything's up-to-date. Nothing to do 16 Rendered layout layouts/application.html.erb (Duration: 16.4ms | Allocations: 4654) 17Completed 200 OK in 331ms (Views: 19.9ms | ActiveRecord: 0.0ms | Allocations: 5757)
試したこと
サーバー再起動、誤字脱字の再確認は一応しました。
routes.rb のファイルで先頭にdevise_for :users があることは確認しました。
routes.rb
1Rails.application.routes.draw do 2 devise_for :users 3 root to: "homes#top" 4 get "/homes/about" => "homes#about", as: 'about' 5 resources :post_images, only: [:new, :create, :index, :show, :destroy] do 6 resources :post_comments, only: [:create] 7 end 8 resources :users, only: [:show, :edit, :update] 9end
補足情報(FW/ツールのバージョンなど)
rails version 6.1.6.1 ?
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2022/07/24 00:59