|
1
|
|
-<div id="appleid-signin"></div>
|
|
|
1
|
+<div id="appleid-signin" data-type="sign in"></div>
|
|
2
|
2
|
<script type="text/javascript" src="https://appleid.cdn-apple.com/appleauth/static/jsapi/appleid/1/en_US/appleid.auth.js"></script>
|
|
3
|
3
|
<style>
|
|
4
|
4
|
#appleid-signin {
|
|
5
|
5
|
width: 210px;
|
|
6
|
6
|
height: 40px;
|
|
7
|
7
|
}
|
|
8
|
|
-</style> |
|
|
\ No newline at end of file |
|
|
8
|
+</style>
|
|
|
9
|
+<script type="text/javascript">
|
|
|
10
|
+ AppleID.auth.init({
|
|
|
11
|
+ clientId : 'com.appdocks8',
|
|
|
12
|
+ scope : 'email name',
|
|
|
13
|
+ redirectURI : 'https://www.appdocks8.com/register',
|
|
|
14
|
+ usePopup : true
|
|
|
15
|
+ });
|
|
|
16
|
+
|
|
|
17
|
+ document.addEventListener('AppleIDSignInOnSuccess', (event) => {
|
|
|
18
|
+ alert('success');
|
|
|
19
|
+ // Handle successful response.
|
|
|
20
|
+ console.log(event.detail.data);
|
|
|
21
|
+ });
|
|
|
22
|
+
|
|
|
23
|
+ // Listen for authorization failures.
|
|
|
24
|
+ document.addEventListener('AppleIDSignInOnFailure', (event) => {
|
|
|
25
|
+ alert('error');
|
|
|
26
|
+ console.log(event.detail.error);
|
|
|
27
|
+ });
|
|
|
28
|
+
|
|
|
29
|
+</script> |
|
|
\ No newline at end of file |
...
|
...
|
|