Permalink
Browse files

Fakeissuer updates

  • Loading branch information...
1 parent a002a7e commit 5bef0f3e0954c604d9c3118188ec93be1dd63e4f @brianloveswords brianloveswords committed Mar 14, 2013
Showing with 25 additions and 1 deletion.
  1. +17 −0 fakeissuer/issuer.js
  2. +8 −1 fakeissuer/static/index.html
View
@@ -75,6 +75,23 @@ app.get('/raw.json', function (req, res) {
});
});
+app.get('/old.json', function (req, res) {
+ return res.json({
+ recipient: req.query.email,
+ badge: {
+ version: '0.5.0',
+ name: 'Badge',
+ description: 'Description',
+ image: makeUrl(req, '/badge.png'),
+ criteria: makeUrl(req, '/criteria'),
+ issuer: {
+ name: 'Issuer',
+ origin: makeUrl(req, '/')
+ }
+ }
+ });
+});
+
app.get('/hashed.json', function (req, res) {
var salt = 'yah';
return res.json({
@@ -16,6 +16,7 @@
<label>Email or Signature: <input id='email'></label>
<label>Modaless: <input id='modaless' type='checkbox'></label>
+ <button id="old">Old</button>
<button id="unhashed">Unhashed</button>
<button id="hashed">Hashed</button>
<button id="invalid">Invalid</button>
@@ -28,6 +29,7 @@
}
+ var old = document.getElementById('old');
var unhashed = document.getElementById('unhashed');
var hashed = document.getElementById('hashed');
var invalid = document.getElementById('invalid');
@@ -43,6 +45,11 @@
}
}
+ old.addEventListener('click', function(){
+ var url = qualify('/old.json?email=') + encodeURIComponent(getEmail());
+ issue(url)
+ },false)
+
unhashed.addEventListener('click', function(){
var url = qualify('/raw.json?email=') + encodeURIComponent(getEmail());
issue(url)
@@ -65,6 +72,6 @@
},false)
</script>
- <script src="http://openbadges.mofostaging.net/issuer.js"></script>
+ <script src="http://localhost:8888/issuer.js"></script>
</body>
</html>

0 comments on commit 5bef0f3

Please sign in to comment.