-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrba.html
42 lines (40 loc) · 1.73 KB
/
rba.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
<!DOCTYPE html>
<head>
<title>RBA Exercise</title>
<meta name="viewport" content="width=device-width">
<script type="text/javascript" lang="javascript" src="https://cdns.gigya.com/js/gigya.js?apikey=4_-7c3SnVVF2wkdl-kf9VQYg"></script>
</head>
<body>
<h1>RBA Exercises</h1>
<h4>Register a user and then try to login with a wrong password 5 times</h4>
<a href="#" onclick="gigya.accounts.showScreenSet({screenSet:'Default-RegistrationLogin', startScreen:'gigya-register-screen'})">Register</a>
|
<a href="#" onclick="gigya.accounts.showScreenSet({screenSet:'Default-RegistrationLogin'})">Login</a>
|
<span id="logout" hidden> | <a href="#" onclick="logout();">Logout</a></span>
<script type="text/javascript" lang="javascript">
function logout() {
gigya.accounts.logout({callback:function(response) {
if(response.errorCode==0) {
document.getElementById("logout").hidden=true;
}
else {
alert('Error:'+response.errorMessage);
}
}});
}
// if there's a user logged in then shows the logout link
gigya.accounts.getAccountInfo({callback:function(response) {
if(response.errorCode == 0) {
document.getElementById("logout").hidden=false;
}
}});
// traps the login event to show the logout link
gigya.socialize.addEventHandlers({
onLogin: function() {
document.getElementById("logout").hidden=false;
}
});
</script>
</body>
</html>