rails devise gem redirect loop -
I am using a devise gem with a Rail 4.1.4 app, and adding some custom key-value additions to it Is required
I override the following methods However, signing in However, with the following output I Every time I finally redirected to the root path (the browser temporarily redirects me to the root before the redirect loop shows the error message). Edit: Then it is known that I have 2 different models (user and administrator), in this line of code, Creating url is How do I create a url_ for the user's model and not the admin model? Thank you! Yourself went to this issue for any reason, Instead, get rid of and The helper creates your code cleaner and allows you to specify which system model you want.
after_sign_in_path_for (resource)
after_sign_up_path_for (resource)
According to the after_update_path_for (resource)
after_resetting_password_path_for (resource) methods specified here:
after_sign_in_path _for I enter several times:
Obtain "/ user / sign-in" for 127.0.0.1 on 2014/07/07 - 10-08 22:56: 45 +0530 Processive Davis :: Sessions Controller # HTML as the new
Select user load (0.3ms) "Users". * "User" by "user" "id" = 1 "user" by ORDER. "ID" ASC limit1
http: // localhost: 3000 / users / sign_in Filters series has been redirected: need_no_authentication rendered or guided full 302 3ms (ActiveRecord: 0.6ms )
After_sign_in_path_for :
sign_in_url = url_for (: action = & gt; 'new' ,: controller = & gt; 'session', only: path = & gt; wrong, protocol = & Gt; 'http')
"http: // localhost: 3000 / admins / sign_in" "http: // localhost: 3000 / Users / sign_in "instead of
url_for The administrator looks the default (do not know why) The good news is that you do not have to use
url_for to complete this
sign_in_url = url_for (: action = & gt; 'new' ,: controller = & gt;,: = _path = & gt; wrong, protocol = & gt; ; 'Http')
Change if request.referer == sign_in_url with
P>
Aug R request.referer == new_user_session_url
Comments
Post a Comment