Moved to User.authenticate() for http basic auth.
This commit is contained in:
parent
0dc3cc0d00
commit
1f0a671c5c
1 changed files with 4 additions and 3 deletions
|
@ -69,14 +69,15 @@ class ApplicationController < ActionController::Base
|
||||||
# puts params.inspect
|
# puts params.inspect
|
||||||
|
|
||||||
# check http basic auth
|
# check http basic auth
|
||||||
authenticate_with_http_basic do |user, password|
|
authenticate_with_http_basic do |username, password|
|
||||||
puts 'http basic auth check'
|
puts 'http basic auth check'
|
||||||
userdata = User.lookup( :login => user )
|
userdata = User.lookup( :login => username )
|
||||||
message = ''
|
message = ''
|
||||||
if !userdata
|
if !userdata
|
||||||
message = 'authentication failed, user'
|
message = 'authentication failed, user'
|
||||||
else
|
else
|
||||||
if password != userdata.password
|
success = User.authenticate( username, password )
|
||||||
|
if !success
|
||||||
message = 'authentication failed, pw'
|
message = 'authentication failed, pw'
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue