<% include ../partials/header %>

<html>
    <head>
        <meta charset="utf-8"/>
        <meta name="google-signin-client_id" content="738623758537-bhe6ag4hcbbgvk4vlp9f2n7hqsbr0bt2.apps.googleusercontent.com">
        <script src="https://apis.google.com/js/platform.js" async defer></script>

    </head>
    <body style="padding: 0;">  

        <div class="container-fluid" style="padding: 0; margin: 0;">
            <div class="header-container">
                <img class="header-image" src="https://www.amrita.edu/sites/default/files/logo.png">
                <!-- https://www.pngitem.com/pimgs/m/539-5392274_amrita-university-logo-hd-png-download.png -->
                <h1 class="header-text">Faculty Dashboard</h1>
            </div>
        </div>
             
        <div class="container mt-5">
            <div class="row">
              <!-- <div class="col-md-3">
                <img src="https://www.pngitem.com/pimgs/m/539-5392274_amrita-university-logo-hd-png-download.png" height="250px" style="margin-top:9px; margin-left:170px;">
              </div> -->
        
              <div class="col-md-6 offset-md-3">
                <div class="card transparent-container">
                    <div class="card-header text-center login-card-header">
                    <img class="login-image-logo" src="https://www.pngitem.com/pimgs/m/539-5392274_amrita-university-logo-hd-png-download.png">
                    <h4 class="h3-login login-h4">Google Sign-In</h4>
                    <hr class="hr-login">
                    </div>

                    <div class="card-block">
                        <form class="p-3" action="/auth/user-login" method="POST">
                        <div class="form-group">
                            <div id="profileinfo"></div> 
                            <div class="g-signin2" data-onsuccess="onSignIn"></div>
                        </div>
                        <a  class="login-button btn btn-block" href="/" onclick="signOut();"> <b class=" g-signout">Go back</b></a>
                        </form>
                    </div>
                </div>
              </div>
            </div>
        
          </div>

        <br>

        


        <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()); // This is null if the 'email' scope is not present.
            }
        </script>
        
        <script>
function signOut() {
    var auth2 = gapi.auth2.getAuthInstance();
    auth2.signOut().then(function () {
      console.log('User signed out.');
    });
  }

        </script>
    </body>
    </html>


