I have a little problem with devise. After signing out, when i fill up "signing in" form first time it writes a validation error
You need to sign in or sign up before continuing.
but when i am submitting form second time i don't have any errors. And signs in successfully.
I do sign out using link
<%= link_to "Sign out", destroy_user_session_path, :method => :delete %>
also, after signing up, it redirects me on signing in form and writes validation error:
You need to sign in or sign up before continuing.
but entering the same again it works fine
what I am doing wrong? Thanks in advance!
You need to sign in or sign up before continuing.
This error message is cause from authenticate_user!
in controller.
I think your redirection have sent you to some where that have the method
before_filter: authenticate_user!
For the after you sign_out
by default devise will redirect you to root_path . See this link for detail for redirection after sign out.
And for the after sign_up
devise will redirection you to root_path or the path that you want to go. See this link for after signup redirection.
I hope this might help where you miss in your code.
Try to check your root in route file.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.