Skip to content

Latest commit

 

History

History
60 lines (44 loc) · 2.31 KB

README.md

File metadata and controls

60 lines (44 loc) · 2.31 KB

Laravel UI Socialite

Laravel 8 codecov LICENSE

Automatically generate database, pages, and routes for Laravel Socialite. Just like php artisan ui:auth.

Login with multiple providers using the same email will be determined as one user.

When logged in, you can link all providers to the current user, and login with them next time.

Special handling for WeChat.

install

composer require laravel-fans/ui-socialite
php artisan ui vue
php artisan ui:auth
php artisan ui:socialite
php artisan vendor:publish --provider="LaravelFans\UiSocialite\UiSocialiteServiceProvider"
php artisan migrate

config

add to config/services.php:

    'github' => [
        'client_id' => env('GITHUB_CLIENT_ID'),
        'client_secret' => env('GITHUB_CLIENT_SECRET'),
        'redirect' => env('GITHUB_CALLBACK_URL'),
        'scopes' => env('GITHUB_SCOPES'), // optional
    ],

add to .env:

AUTH_SOCIAL_LOGIN_PROVIDERS=Facebook,Twitter,Linkedin,Google,GitHub,GitLab,Bitbucket,wechat_web,wechat_service_account
GITHUB_CLIENT_ID=foo
GITHUB_CLIENT_SECRET=bar
GITHUB_CALLBACK_URL=http://127.0.0.1:8000/login/github/callback
GITHUB_SCOPES=user:email,public_repo

# disable password login
AUTH_PASSWORD_LOGIN_ENABLED=0

# disable register
AUTH_OPTIONS_REGISTER=0

screenshots

Laravel Socialite Login page GitHub OAuth Login Laravel Socialite Profile page and Linked Accounts Laravel Socialite link multiple providers to one user