Thanks callahad for pointing this out.
}
var logout_url = document.getElementById('_logout_url').value;
+ var persona_user = document.getElementById('_persona_user').value;
navigator.id.watch({
+ loggedInUser: persona_user || null,
onlogin: function(assertion) {
document.getElementById('_assertion').value = assertion;
- document.getElementById('_persona_login').submit()
+ document.getElementById('_persona_login').submit();
},
onlogout: function() {
$.ajax({
<input type="hidden" name="assertion" type="text" id="_assertion"/>
<input type="hidden" name="_logout_url" type="text" id="_logout_url"
value="{{ request.urlgen('mediagoblin.auth.logout') }}"/>
+ <input type="hidden" type="text" id="_persona_user"
+ {% if request.session.get('persona_login_email', False) %}
+ value="{{ request.session['persona_login_email'] }}"/>
+ {% else %}
+ value=""/>
+ {% endif %}
</form>
{% endblock %}
if user:
request.session['user_id'] = unicode(user.id)
+ request.session['persona_login_email'] = email
request.session.save()
return redirect(request, "index")
new_entry.user_id = request.user.id
new_entry.save()
+ request.session['persona_login_email'] = email
+
messages.add_message(
request,
messages.SUCCESS,