summaryrefslogtreecommitdiff
path: root/example/views
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/views
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/views')
-rw-r--r--example/views/authenticate.erb8
-rw-r--r--example/views/handshake.erb2
-rw-r--r--example/views/layout.erb1
-rw-r--r--example/views/login.erb22
4 files changed, 19 insertions, 14 deletions
diff --git a/example/views/authenticate.erb b/example/views/authenticate.erb
new file mode 100644
index 0000000..7d6e39f
--- /dev/null
+++ b/example/views/authenticate.erb
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<% if @auth[:M2] %>
+ <M><%=@auth[:M2]%></M>
+<% end %>
+<% if @auth[:error] %>
+ <error><%=@auth[:error]%></error>
+<% end %>
+
diff --git a/example/views/handshake.erb b/example/views/handshake.erb
new file mode 100644
index 0000000..66fac73
--- /dev/null
+++ b/example/views/handshake.erb
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<r s="<%=@user.salt%>" B="<%=@auth[:B]%>" />
diff --git a/example/views/layout.erb b/example/views/layout.erb
index d7e9985..ab980c8 100644
--- a/example/views/layout.erb
+++ b/example/views/layout.erb
@@ -22,6 +22,7 @@
<%= yield %>
<script type="text/javascript" src="jquery.min.js"> </script>
+ <script type="text/javascript" src="srp.min.js"> </script>
<script type="text/javascript" src="srp.js"> </script>
</body>
diff --git a/example/views/login.erb b/example/views/login.erb
index 131b0b9..eb750a4 100644
--- a/example/views/login.erb
+++ b/example/views/login.erb
@@ -1,26 +1,20 @@
<h2>2. Login</h2>
<form class="form-horizontal" action="/login" method="POST">
- <legend>Login with the user you <a href="/signup.html">created</a>.</legend>
+ <legend>Login with the user you <a href="/signup">created</a>.</legend>
<div class="control-group">
- <label class="control-label" for="login">Login</label>
- <input type="text" class="input-xlarge" name="login"></input>
+ <label class="control-label" for="srp_username">Login</label>
+ <input type="text" class="input-xlarge" id="srp_username" name="srp_username"></input>
</div>
<div class="control-group">
- <label class="control-label" for="password">Password</label>
- <input type="password" class="input-xlarge" name="password"></input>
- </div>
- <div class="control-group">
- <label class="control-label" for="srp-bb">B</label>
- <input type="text" class="input-xlarge" disabled id="srp-bb" name="srp-bb" value="<%=@auth[:bb]%>"></input>
- </div>
- <div class="control-group">
- <label class="control-label" for="srp-u">u</label>
- <input type="text" class="input-xlarge" disabled id="srp-u" name="srp-u" value="<%=@auth[:u]%>"></input>
+ <label class="control-label" for="srp_password">Password</label>
+ <input type="password" class="input-xlarge" id="srp_password" name="srp_password"></input>
</div>
+ <input type="hidden" id="srp_url" name="srp_url" value="/"></input>
+ <input type="hidden" id="srp_server" name="srp_server" value="django"></input>
<div class="form-actions">
- <button type="submit" class="btn btn-primary">Login</button>
+ <button type="submit" class="btn btn-primary" id="login-btn">Login</button>
<a href="/" class="btn">Cancel</a>
</div>
</form>