-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
34 lines (32 loc) · 882 Bytes
/
index.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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>Persona Tests</title>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>
<script src="https://login.persona.org/include.js"></script>
<script type="text/javascript">
$(function() {
navigator.id.watch({
loggedInUser: null,
onlogin: function(assertion) {
$.ajax({
url: '/login',
data: JSON.stringify({assertion: assertion}),
type: 'POST',
contentType: 'application/json; charset=UTF-8',
});
},
onlogout: function() {}
});
$('#login').click(function() {
navigator.id.request({siteName: 'Persona Tests'});
});
navigator.id.logout();
});
</script>
</head>
<body>
<button id="login" type="button">Test Login</button>
</body>
</html>