mirror of
https://github.com/discourse/discourse.git
synced 2024-12-04 19:13:45 +08:00
26 lines
691 B
Plaintext
26 lines
691 B
Plaintext
|
<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>
|