# HG changeset patch # User Jeff Hammel # Date 1388377238 28800 # Node ID 54a53bbe5be9260fce7c79978da9019dfcdfb305 # Parent 158b469a10e97b8b7c1a552a56d63d64e058e4ea bitsyauth/__init__.py example/persona.html diff -r 158b469a10e9 -r 54a53bbe5be9 bitsyauth/__init__.py --- a/bitsyauth/__init__.py Sat Dec 28 14:26:29 2013 -0800 +++ b/bitsyauth/__init__.py Sun Dec 29 20:20:38 2013 -0800 @@ -49,11 +49,14 @@ self.realm = realm or self.site self.captcha = True self.urls = { 'login': '/login', 'join': '/join', } + + # CAPTCHAs + # using skimpygimpy (for now) self.keys = {} # keys, words for CAPTCHA request - self.content_type = { 'image_captcha': 'image/png', 'wav_captcha': 'audio/wav' } + # new user creation if newuser: self.newuser = newuser else: diff -r 158b469a10e9 -r 54a53bbe5be9 example/persona.html --- a/example/persona.html Sat Dec 28 14:26:29 2013 -0800 +++ b/example/persona.html Sun Dec 29 20:20:38 2013 -0800 @@ -22,15 +22,14 @@ // A user has logged in! Here you need to: // 1. Send the assertion to your backend for verification and to create a session. // 2. Update your UI. - $.ajax({ - type: 'POST', - url: '/auth/login', // This is a URL on your website. - data: {assertion: assertion}, - success: function(res, status, xhr) { window.location.reload(); }, - error: function(xhr, status, err) { - navigator.id.logout(); - alert("Login failure: " + err); - } + $.ajax({type: 'POST', + url: '/auth/login', // This is a URL on your website. + data: {assertion: assertion}, + success: function(res, status, xhr) { window.location.reload(); }, + error: function(xhr, status, err) { + navigator.id.logout(); + alert("Login failure: " + err); + } }); }, onlogout: function() { @@ -38,12 +37,12 @@ // Tear down the user's session by redirecting the user or making a call to your backend. // Also, make sure loggedInUser will get set to null on the next page load. // (That's a literal JavaScript null. Not false, 0, or undefined. null.) - $.ajax({ - type: 'POST', - url: '/auth/logout', // This is a URL on your website. - success: function(res, status, xhr) { window.location.reload(); }, - error: function(xhr, status, err) { alert("Logout failure: " + err); } - }); + // $.ajax({ + // type: 'POST', + // url: '/auth/logout', // This is a URL on your website. + // success: function(res, status, xhr) { window.location.reload(); }, + // error: function(xhr, status, err) { alert("Logout failure: " + err); } + // }); } });