mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-10 13:12:50 +01:00
f745c3f0a6
* Laravel Socialite + Refactor for searching for Users across multiple databases * Refactor for Unique User Rules, add Middleware for setting active DB connection per request, more tests
35 lines
656 B
PHP
35 lines
656 B
PHP
<?php
|
|
|
|
namespace App\Libraries;
|
|
|
|
use Laravel\Socialite\Facades\Socialite;
|
|
|
|
/**
|
|
* Class OAuth
|
|
* @package App\Libraries
|
|
*/
|
|
class OAuth
|
|
{
|
|
|
|
/**
|
|
* Socialite Providers
|
|
*/
|
|
const SOCIAL_GOOGLE = 1;
|
|
const SOCIAL_FACEBOOK = 2;
|
|
const SOCIAL_GITHUB = 3;
|
|
const SOCIAL_LINKEDIN = 4;
|
|
const SOCIAL_TWITTER = 5;
|
|
const SOCIAL_BITBUCKET = 6;
|
|
|
|
/**
|
|
* @param Socialite $user
|
|
*/
|
|
|
|
public static function handleAuth($user)
|
|
{
|
|
if(MultiDB::checkUserEmailExists($user->getEmail())) //if email is in the system this is an existing user -> check they are arriving on the correct provider
|
|
{
|
|
|
|
}
|
|
}
|
|
} |