Permalink
Browse files

5.2.javascript로 로그인 구현 - auth2 초기화

  • Loading branch information...
egoing committed Aug 26, 2018
1 parent 180767f commit 1e8f22686ba7b40fcee7bd502d0c2ce657e472f3
Showing with 8 additions and 11 deletions.
  1. +8 −11 index.html
View
@@ -5,27 +5,24 @@
<meta charset="utf-8">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script src="colors.js"></script>
<meta name="google-signin-client_id" content="1069961247398-d5cpi17r74jaad01cf93gbilfnaf3mf4.apps.googleusercontent.com">
<script>
function init(){
console.log('init');
gapi.load('auth2', function() {
console.log('auth2');
var gauth = gapi.auth2.init({
client_id:'1069961247398-d5cpi17r74jaad01cf93gbilfnaf3mf4.apps.googleusercontent.com'
})
gauth.then(function(){
console.log('googleAuth success');
}, function(){
console.log('googleAuth fail');
});
});
}
</script>
<script>
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());
}
</script>
</head>
<body>
<div class="g-signin2" data-onsuccess="onSignIn"></div>
<h1><a href="index.html">WEB</a></h1>
<input id="night_day" type="button" value="night" onclick="
nightDayHandler(this);

0 comments on commit 1e8f226

Please sign in to comment.