summaryrefslogtreecommitdiff
path: root/users/app/controllers
diff options
context:
space:
mode:
authorjessib <jessib@riseup.net>2012-10-08 10:52:20 -0700
committerjessib <jessib@riseup.net>2012-10-08 10:52:20 -0700
commitf77301824c42bdd4559a0b0e58b8f3c26f239643 (patch)
treec815c1c82e4350e12e6ee38d00b979812fa840c2 /users/app/controllers
parentc4220a167f883f31c408b55cd970761faeb53aa5 (diff)
parente264e7354788c0b7eff7bb296eed9c59304cc8b8 (diff)
Merge remote branch 'origin/release-0.1.0' into help_develop
Diffstat (limited to 'users/app/controllers')
-rw-r--r--users/app/controllers/sessions_controller.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/users/app/controllers/sessions_controller.rb b/users/app/controllers/sessions_controller.rb
index b8043f5..284c0e2 100644
--- a/users/app/controllers/sessions_controller.rb
+++ b/users/app/controllers/sessions_controller.rb
@@ -9,7 +9,7 @@ class SessionsController < ApplicationController
@user = User.find_by_param(params[:login])
session[:handshake] = @user.initialize_auth(params['A'].hex)
User.current = @user #?
- render :json => { :B => session[:handshake].bb.to_s(16), :salt => @user.password_salt }
+ render :json => session[:handshake]
rescue RECORD_NOT_FOUND
render :json => {:errors => {:login => ["unknown user"]}}
end
@@ -18,10 +18,10 @@ class SessionsController < ApplicationController
# TODO: validate the id belongs to the session
@user = User.find_by_param(params[:id])
@srp_session = session.delete(:handshake)
- @server_auth = @srp_session.authenticate!(params[:client_auth].hex)
+ @srp_session.authenticate!(params[:client_auth].hex)
session[:user_id] = @user.id
User.current = @user #?
- render :json => {:M2 => "%064x" % @server_auth}
+ render :json => @srp_session
rescue WRONG_PASSWORD
session[:handshake] = nil
render :json => {:errors => {"password" => ["wrong password"]}}