PHP Class BookStack\Services\SocialAuthService

Afficher le fichier Open project: ssddanbrown/bookstack Class Usage Examples

Protected Properties

Свойство Type Description
$socialAccount
$socialite
$userRepo
$validSocialDrivers

Méthodes publiques

Méthode 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

Méthode 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 méthode

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 méthode

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

fillSocialAccount() public méthode

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

getActiveDrivers() public méthode

Gets the names of the active social drivers.
public getActiveDrivers ( ) : array
Résultat array

handleLoginCallback() public méthode

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

handleRegistrationCallback() public méthode

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

startLogIn() public méthode

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

startRegister() public méthode

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

Property Details

$socialAccount protected_oe property

protected $socialAccount

$socialite protected_oe property

protected $socialite

$userRepo protected_oe property

protected $userRepo

$validSocialDrivers protected_oe property

protected $validSocialDrivers