Skip to content

Login with google one tap/google popup login for Laravel 🔥

License

Notifications You must be signed in to change notification settings

phhung1901/google-one-tap

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Latest Version on Packagist Total Downloads

google-one-tap

Login with google one tap/google popup login for Laravel title


Installation

requires

  • php: >=8.1
  • laravel/framework: ^9.0 || ^10.0 || ^11.0
composer require phhung1901/google_one_tap

Config

Add configuration to config/services.php

'google' => [
  'client_id' => env('GOOGLE_CLIENT_ID'),
  'client_secret' => env('GOOGLE_CLIENT_SECRET'),
  'redirect' => env('GOOGLE_URL')
],

Usage

1. Added to scripts

<script src="https://accounts.google.com/gsi/client" async="" defer=""></script>

2. Next, you must publish the component

Add to providers config/app.php

\GoogleOneTap\Services\GoogleOneTapServiceProvider::class,
php artisan vendor:publish --tag=google_one_tap

Now, add the component wherever you want google_one_tap to be used.

<x-google_one_tap.onload/>

Config googe-one-tap.php you can add customizations

3. Returned User fields

$token = GoogleOneTapService::getToken($request);
return Socialite::driver('google-one-tap')->stateless()->userFromToken($token)

License

The MIT License (MIT). Please see License File for more information.

About

Login with google one tap/google popup login for Laravel 🔥

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published