PHP Class BookStack\Services\SocialAuthService

Show file Open project: ssddanbrown/bookstack Class Usage Examples

Protected Properties

Property Type Description
$socialAccount
$socialite
$userRepo
$validSocialDrivers

Public Methods

Method Description
__construct ( UserRepo $userRepo, Laravel\Socialite\Contracts\Factory $socialite, SocialAccount $socialAccount ) SocialAuthService constructor.
detachSocialAccount ( $socialDriver ) : Illuminate\Http\RedirectResponse | Redirector Detach a social account from a user.
fillSocialAccount ( string $socialDriver, Laravel\Socialite\Contracts\User $socialUser ) : SocialAccount
getActiveDrivers ( ) : array Gets the names of the active social drivers.
handleLoginCallback ( $socialDriver ) : Illuminate\Http\RedirectResponse | Redirector Handle the login process on a oAuth callback.
handleRegistrationCallback ( $socialDriver ) : Laravel\Socialite\Contracts\User Handle the social registration process on callback.
startLogIn ( string $socialDriver ) : RedirectResponse Start the social login path.
startRegister ( string $socialDriver ) : RedirectResponse Start the social registration process

Private Methods

Method Description
checkDriverConfigured ( $driver ) : boolean Check a social driver has been configured correctly.
logUserIn ( $user )
validateDriver ( $socialDriver ) : string Ensure the social driver is correct and supported.

Method Details

__construct() public method

SocialAuthService constructor.
public __construct ( UserRepo $userRepo, Laravel\Socialite\Contracts\Factory $socialite, SocialAccount $socialAccount )
$userRepo BookStack\Repos\UserRepo
$socialite Laravel\Socialite\Contracts\Factory
$socialAccount BookStack\SocialAccount

detachSocialAccount() public method

Detach a social account from a user.
public detachSocialAccount ( $socialDriver ) : Illuminate\Http\RedirectResponse | Redirector
$socialDriver
return Illuminate\Http\RedirectResponse | Illuminate\Routing\Redirector

fillSocialAccount() public method

public fillSocialAccount ( string $socialDriver, Laravel\Socialite\Contracts\User $socialUser ) : SocialAccount
$socialDriver string
$socialUser Laravel\Socialite\Contracts\User
return BookStack\SocialAccount

getActiveDrivers() public method

Gets the names of the active social drivers.
public getActiveDrivers ( ) : array
return array

handleLoginCallback() public method

Handle the login process on a oAuth callback.
public handleLoginCallback ( $socialDriver ) : Illuminate\Http\RedirectResponse | Redirector
$socialDriver
return Illuminate\Http\RedirectResponse | Illuminate\Routing\Redirector

handleRegistrationCallback() public method

Handle the social registration process on callback.
public handleRegistrationCallback ( $socialDriver ) : Laravel\Socialite\Contracts\User
$socialDriver
return Laravel\Socialite\Contracts\User

startLogIn() public method

Start the social login path.
public startLogIn ( string $socialDriver ) : RedirectResponse
$socialDriver string
return Symfony\Component\HttpFoundation\RedirectResponse

startRegister() public method

Start the social registration process
public startRegister ( string $socialDriver ) : RedirectResponse
$socialDriver string
return Symfony\Component\HttpFoundation\RedirectResponse

Property Details

$socialAccount protected property

protected $socialAccount

$socialite protected property

protected $socialite

$userRepo protected property

protected $userRepo

$validSocialDrivers protected property

protected $validSocialDrivers