You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have this issue when I login; I am redirecting the user after login to stores/dashboard;
for some reason I got the 401 Unauthorized. Also I had to include the patch for the user model.
Due a reason authenticate_user is not working properly
Controller
class StoresController < ApplicationController
before_action :authenticate_user!, :except => [:index]
def index
end
def dashboard
end
end
Started POST "/users/sign_in" for 127.0.0.1 at 2014-08-21 09:48:59 -0400
Processing by Devise::SessionsController#create as HTML
Parameters: {"utf8"=>"✓", "authenticity_token"=>"n7t7mLISBOGMYWxJWzw8qNHwP3y9HGR+79P0vmEodEg=", "user"=>{"email"=>"victornsosa@gmail.com", "password"=>"[FILTERED]", "remember_me"=>"0"}, "commit"=>"Sign in"}
MOPED: 127.0.0.1:27017 COMMAND database=admin command={:ismaster=>1} runtime: 0.7452ms
MOPED: 127.0.0.1:27017 QUERY database=prometheus_development collection=users selector={"$query"=>{"email"=>"victornsosa@gmail.com"}, "$orderby"=>{:_id=>1}} flags=[] limit=-1 skip=0 batch_size=nil fields=nil runtime: 0.6844ms
MOPED: 127.0.0.1:27017 UPDATE database=prometheus_development collection=users selector={"_id"=>BSON::ObjectId('53f5eded6265743c0a010000')} update={"$set"=>{"last_sign_in_at"=>2014-08-21 13:32:55 UTC, "current_sign_in_at"=>2014-08-21 13:48:59 UTC, "sign_in_count"=>9}} flags=[]
COMMAND database=prometheus_development command={:getlasterror=>1, :w=>1} runtime: 0.5836ms
Redirected to http://localhost:3000/stores/dashboard
Completed 302 Found in 88ms
Started GET "/stores/dashboard" for 127.0.0.1 at 2014-08-21 09:48:59 -0400
Processing by StoresController#dashboard as HTML
MOPED: 127.0.0.1:27017 QUERY database=prometheus_development collection=users selector={"$query"=>{"_id"=>"[{\"$oid\"=>\"53f5eded6265743c0a010000\"}]"}, "$orderby"=>{:_id=>1}} flags=[] limit=-1 skip=0 batch_size=nil fields=nil runtime: 0.3786ms
**Completed 401 Unauthorized in 2ms**
Started GET "/users/sign_in" for 127.0.0.1 at 2014-08-21 09:48:59 -0400
Processing by Devise::SessionsController#new as HTML
Rendered devise/shared/_links.erb (1.0ms)
Rendered devise/sessions/new.html.erb within layouts/application (5.3ms)
Completed 200 OK in 20ms (Views: 18.9ms)
patch on user.rb
class << self
def serialize_from_session(key,salt)
#record = to_adapter.get(key[0].to_param)
record = to_adapter.get(key.to_s)
record if record && record.authenticatable_salt == salt
end
end
The text was updated successfully, but these errors were encountered:
using rails 4.1.4, devise 3.2.4 and mongoid 4.0
I have this issue when I login; I am redirecting the user after login to stores/dashboard;
for some reason I got the 401 Unauthorized. Also I had to include the patch for the user model.
Due a reason authenticate_user is not working properly
Controller
routes.rb
patch on user.rb
The text was updated successfully, but these errors were encountered: