summaryrefslogtreecommitdiff
path: root/example/http-srp.rb
diff options
context:
space:
mode:
authorAzul <azul@leap.se>2012-06-27 15:08:41 +0200
committerAzul <azul@leap.se>2012-06-27 15:08:41 +0200
commit95df478b7d3f62e2893499aa7a801b0cacb19dcd (patch)
tree309b85fff49ad0108eb3413104a3379a7d91d347 /example/http-srp.rb
parentbd88f52b03c2b8061aa753b7d925dd9bc4057e6e (diff)
moved to ajax workflow and integrated srp-js - not quite there yet
* needs a bit of cleanup from the old workflow * are client and server using the same primes right now? * store multiple users on the server side
Diffstat (limited to 'example/http-srp.rb')
-rw-r--r--example/http-srp.rb21
1 files changed, 17 insertions, 4 deletions
diff --git a/example/http-srp.rb b/example/http-srp.rb
index d0b32dd..4c34130 100644
--- a/example/http-srp.rb
+++ b/example/http-srp.rb
@@ -24,12 +24,25 @@ end
get '/login' do
@user = User.current
- Log.log(:init_server_login, params)
- @auth = @user.initialize_auth(params)
- Log.log(:init_client_login, @auth)
erb :login
end
+post '/handshake/' do
+ @user = User.current
+ Log.log(:handshake, params)
+ @auth = @user.initialize_auth(params)
+ Log.log(:init_auth, @auth)
+ erb :handshake, :layout => false, :content_type => :xml
+end
+
+post '/authenticate/' do
+ @user = User.current
+ Log.log(:authenticate, params)
+ @auth = @user.authenticate(params)
+ Log.log(:confirm_authentication, @auth)
+ erb :authenticate, :layout => false, :content_type => :xml
+end
+
post '/login' do
Log.log(:login, params)
@user = User.current
@@ -54,6 +67,6 @@ helpers do
klass += " btn-primary"
label += " now..."
end
- %Q(<a href="#{action}" class="#{klass}" id="#{action}-btn">#{label}</a>)
+ %Q(<a href="#{action}" class="#{klass}" id="#{action}-view-btn">#{label}</a>)
end
end