summaryrefslogtreecommitdiff
path: root/example/http-srp.rb
diff options
context:
space:
mode:
authorAzul <azul@leap.se>2012-06-28 16:13:13 +0200
committerAzul <azul@leap.se>2012-06-28 16:13:13 +0200
commite55ff681bcc5a6c479530d1411a3da75912d78e5 (patch)
treeaca518663d05f3093520fd3b5d0449efe0b7eb84 /example/http-srp.rb
parent424c80fde151d4507cd34aaf8f116016df405c8a (diff)
complete ajax flow is working - just auth fails
Also we currently generate the salt on the server - this should happen on the client but for now i stick to the srp-js workflow.
Diffstat (limited to 'example/http-srp.rb')
-rw-r--r--example/http-srp.rb15
1 files changed, 10 insertions, 5 deletions
diff --git a/example/http-srp.rb b/example/http-srp.rb
index b2de7bf..e83036f 100644
--- a/example/http-srp.rb
+++ b/example/http-srp.rb
@@ -14,12 +14,17 @@ get '/signup' do
erb :signup
end
-post '/signup' do
+# TODO: Client should generate the salt!
+# Getting things to work the srp-js way first.
+post '/register/salt/' do
Log.clear
- Log.log(:signup, params)
- @user = User.current
- @user.signup!(params)
- redirect '/'
+ @user = User.new(params.delete('I'))
+ erb :salt, :layout => false, :content_type => :xml
+end
+
+post '/register/user/' do
+ User.current.verifier = params.delete('v').to_i
+ erb :ok, :layout => false, :content_type => :xml
end
get '/login' do