Commit fc162af5d45cc07b14f236799f20ed73cc9e45da
1 parent
54a1e6d4
Exists in
staging
and in
4 other branches
api: fix login from cookie
Showing
1 changed file
with
1 additions
and
0 deletions
Show diff stats
lib/noosfero/api/session.rb
@@ -45,6 +45,7 @@ module Noosfero | @@ -45,6 +45,7 @@ module Noosfero | ||
45 | end | 45 | end |
46 | 46 | ||
47 | post "/login_from_cookie" do | 47 | post "/login_from_cookie" do |
48 | + return unauthorized! if cookies[:auth_token].blank? | ||
48 | user = User.where(remember_token: cookies[:auth_token]).first | 49 | user = User.where(remember_token: cookies[:auth_token]).first |
49 | return unauthorized! unless user && user.activated? | 50 | return unauthorized! unless user && user.activated? |
50 | @current_user = user | 51 | @current_user = user |