summaryrefslogtreecommitdiffstats
path: root/extensions/Persona/template/en/default/hook/account/create-additional_methods.html.tmpl
blob: 9bf95b780fc0e7deef47f9915f170ce650a0cf03 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
[%# This Source Code Form is subject to the terms of the Mozilla Public
  # License, v. 2.0. If a copy of the MPL was not distributed with this
  # file, You can obtain one at http://mozilla.org/MPL/2.0/.
  #
  # This Source Code Form is "Incompatible With Secondary Licenses", as
  # defined by the Mozilla Public License, v. 2.0.
  #%]

[% IF Param('user_info_class').split(',').contains('Persona') %]
<script type="text/javascript">
function persona_create_account() {
    navigator.id.getVerifiedEmail(function(assertion) {
        if (assertion) {
            // This code will be invoked once the user has successfully
            // selected an email address they control to sign in with.
            document.getElementById('persona_assertion').value = assertion;
            document.getElementById('persona_form').submit();
            return true;
        }
    });
}
</script>

Or, use your Persona account:
<img src="extensions/Persona/web/images/sign_in.png" onclick="persona_create_account()">

<form id="persona_form" method="POST" action="index.cgi">
  <input type="hidden" name="token" value="[% issue_hash_token(['login']) FILTER html %]">
  <input type="hidden" name="persona_assertion" id="persona_assertion" value="">
</form>
[% END %]