-
Notifications
You must be signed in to change notification settings - Fork 3
/
landing.html
55 lines (45 loc) · 1.06 KB
/
landing.html
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 http-equiv="X-UA-Compatible" content="IE=Edge">
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Persona Demo Site</title>
<link href="/main.css" rel="stylesheet">
<script src="https://login.persona.org/include.js"></script>
<script src="/persona.js"></script>
<script>
var email = "{{.}}";
if (email === "") {
email = null;
}
navigator.id.watch({
loggedInUser: email,
onlogin: signIn,
onlogout: signOut
});
</script>
<script>
function setStatusText() {
if (email != null) {
$("status").innerHTML = "Hi there " + email + "!";
} else {
$("status").innerHTML = "You are currently not logged in.";
}
}
</script>
</head>
<body spellcheck="false" onload="setStatusText();">
<h1>
Persona Demo Site
</h1>
<p id="status">
</p>
<p>
{{if .}}
<a class="persona-signinout" href="javascript:navigator.id.logout()">Sign out</a>
{{else}}
<a class="persona-signinout" href="javascript:navigator.id.request()">Sign in</a>
{{end}}
</p>
</body>
</html>