34968-vm/auth_google.php
Flatlogic Bot 42cfa7481c V19
2025-10-16 08:36:38 +00:00

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();