16 lines
446 B
PHP
16 lines
446 B
PHP
<?php
|
|
session_start();
|
|
|
|
require_once __DIR__ . '/vendor/autoload.php';
|
|
require_once __DIR__ . '/includes/api_keys.php';
|
|
|
|
$client = new Google_Client();
|
|
$client->setClientId(GOOGLE_CLIENT_ID);
|
|
$client->setClientSecret(GOOGLE_CLIENT_SECRET);
|
|
$client->setRedirectUri('http://' . $_SERVER['HTTP_HOST'] . '/auth_google_callback.php');
|
|
$client->addScope("email");
|
|
$client->addScope("profile");
|
|
|
|
header('Location: ' . $client->createAuthUrl());
|
|
exit();
|