This repository has been archived by the owner on Feb 20, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 15
/
authentication.ejs
55 lines (52 loc) · 1.75 KB
/
authentication.ejs
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title><%= gettext('Loading') %></title>
<meta name="viewport" content="initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0,width=device-width" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<!--[if lt IE 9]>
<%- cachify_js('/js/lib/html5shim.min.js') %>
<![endif]-->
<%- cachify_css('/css/style.min.css') %>
</head>
<body class="auth">
<header id="header">
<h1><a class="home" target="_blank" href="/">Mozilla Persona Home</a></h1>
</header>
<div id="content" class="group">
<section id="error">
<div class="table">
<div class="vertical">
<div class="contents">
<p class="progress b"><%= gettext('Loading') %> <span></span></p>
<img src="/i/progress.gif" width="128" height="15" alt="Loading" />
</div>
</div>
</div>
</section>
</div>
<% if ('development' === dev_mode) { %>
<%- partial('debug_authentication_api') -%>
<% } else { %>
<script type="text/javascript" src="<%= browserid_server %>/authentication_api.js"></script>
<% } %>
<script type="text/javascript">
localStorage.height = window.outerHeight || document.documentElement.offsetHeight;
localStorage.width = window.outerWidth || document.documentElement.offsetWidth;
navigator.id.beginAuthentication(function(email) {
if (email) {
window.location.pathname = '/proxy/' + encodeURIComponent(email);
var parts = email.split('@');
if (parts.length > 1) {
var spans = document.getElementsByTagName('span');
if (spans.length > 0)
spans[0].appendChild(document.createTextNode(parts[1]));
}
} else {
window.location.pathname = '/error';
}
});
</script>
</body>
</html>