Use cached db lookups.
This commit is contained in:
parent
ae20f34944
commit
6f03f17a7a
2 changed files with 2 additions and 2 deletions
|
@ -71,7 +71,7 @@ class ApplicationController < ActionController::Base
|
|||
# check http basic auth
|
||||
authenticate_with_http_basic do |user, password|
|
||||
puts 'http basic auth check'
|
||||
userdata = User.where( :login => user ).first
|
||||
userdata = User.lookup( :login => user )
|
||||
message = ''
|
||||
if !userdata
|
||||
message = 'authentication failed, user'
|
||||
|
|
|
@ -434,7 +434,7 @@ class ClientState
|
|||
return if !session_data
|
||||
return if !session_data[:user]
|
||||
return if !session_data[:user][:id]
|
||||
user = User.where( :id => session_data[:user][:id] ).first
|
||||
user = User.lookup( :id => session_data[:user][:id] )
|
||||
return if !user
|
||||
|
||||
# set cache key
|
||||
|
|
Loading…
Reference in a new issue