E
E
Eugene Burmakin2014-09-27 16:33:33
Ruby on Rails
Eugene Burmakin, 2014-09-27 16:33:33

Why is Devise not authorizing the user?

Rails 4, Devise 3, according to the guide https://github.com/plataformatec/devise/wiki/How-T... set authorization by username. Added a boolean admin attribute to the user.
I register the user, I log in - all is good.
The next day I return to work on the application, I try to log in - and I get

Started POST "/users/sign_in" for 127.0.0.1 at 2014-09-27 20:33:59 +0700
Processing by Devise::SessionsController#create as HTML
  Parameters: {"utf8"=>"✓", "authenticity_token"=>"[FILTERED]", "user"=>{"login"=>"Frey", "password"=>"[FILTERED]", "remember_me"=>"0"}, "commit"=>"Войти"}
Completed 401 Unauthorized in 1ms
Processing by Devise::SessionsController#new as HTML
  Parameters: {"utf8"=>"✓", "authenticity_token"=>"[FILTERED]", "user"=>{"login"=>"Frey", "password"=>"[FILTERED]", "remember_me"=>"0"}, "commit"=>"Войти"}
  Rendered devise/shared/_links.erb (0.6ms)
  Rendered devise/sessions/new.html.erb within layouts/application (12.0ms)
  Rendered layouts/_header.html.erb (0.9ms)
  Rendered shared/_flash_messages.html.erb (0.1ms)
  Rendered layouts/_footer.html.erb (0.3ms)
Completed 200 OK in 244ms (Views: 140.7ms | ActiveRecord: 0.0ms)

Question: why is this happening and how can I cure it? Initial authorization after registration goes well, but later it is simply impossible to log in.
If it is important, there are only a couple of scaffolds in the application so far, which do not touch the authorization in any way.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
I
Ivan Kryak, 2014-09-27
@sck_v

confirmable enabled?
allow_unconfirmed_access_for in the settings?
In my opinion, you just need to confirm the user.

V
Viktor Vsk, 2014-09-27
@viktorvsk

You have uploaded the webserver log. Doesn't the device by default render all asset-record errors?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question