mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-28 10:08:20 -05:00
26 lines
691 B
Text
26 lines
691 B
Text
|
<script src="https://login.persona.org/include.js"></script>
|
||
|
<form id="persona_assertion_form" action="/auth/persona/callback" method="post" target="_blank">
|
||
|
<input type='hidden' name='assertion'/>
|
||
|
</form>
|
||
|
<script>
|
||
|
(function() {
|
||
|
var readyCalled = false;
|
||
|
navigator.id.watch({
|
||
|
onlogin: function(assertion) {
|
||
|
if (readyCalled) {
|
||
|
$('#persona_assertion_form input[name=assertion]').val(assertion);
|
||
|
$('#persona_assertion_form').submit();
|
||
|
}
|
||
|
},
|
||
|
onlogout: function() {
|
||
|
if (readyCalled) {
|
||
|
Discourse.logout();
|
||
|
}
|
||
|
},
|
||
|
onready: function() {
|
||
|
readyCalled = true;
|
||
|
}
|
||
|
});
|
||
|
}());
|
||
|
</script>
|