WIP: add basic stuff
This commit is contained in:
		
							parent
							
								
									336941f584
								
							
						
					
					
						commit
						86e605f265
					
				
							
								
								
									
										16
									
								
								public/app.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										16
									
								
								public/app.js
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,16 @@ | |||||||
|  | 'use strict'; | ||||||
|  | 
 | ||||||
|  | function onSignIn(googleUser) { | ||||||
|  | 	var profile = googleUser.getBasicProfile(); | ||||||
|  | 	console.log('ID: ' + profile.getId()); // Do not send to your backend! Use an ID token instead.
 | ||||||
|  | 	console.log('Name: ' + profile.getName()); | ||||||
|  | 	console.log('Image URL: ' + profile.getImageUrl()); | ||||||
|  | 	console.log('Email: ' + profile.getEmail()); // This is null if the 'email' scope is not present.
 | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  |   function signOut() { | ||||||
|  |     var auth2 = gapi.auth2.getAuthInstance(); | ||||||
|  |     auth2.signOut().then(function () { | ||||||
|  |       console.log('User signed out.'); | ||||||
|  |     }); | ||||||
|  |   } | ||||||
| @ -105,3 +105,8 @@ You shouldn't use it for automated testing, because it will change, but it looks | |||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
| </code></pre> | </code></pre> | ||||||
|  | 
 | ||||||
|  | <script src="https://apis.google.com/js/platform.js" async defer></script> | ||||||
|  | <div class="g-signin2" data-onsuccess="onSignIn"></div> | ||||||
|  | <a href="#" onclick="signOut();">Sign out</a> | ||||||
|  | <script src="app.js"></script> | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user