Bristol SU Support Package
Public Member Functions | Private Attributes | List of all members
BristolSU\Support\User\UserApiAuthentication Class Reference
Inheritance diagram for BristolSU\Support\User\UserApiAuthentication:
Inheritance graph
[legend]
Collaboration diagram for BristolSU\Support\User\UserApiAuthentication:
Collaboration graph
[legend]

Public Member Functions

 __construct (AuthFactory $auth)
 
 getUser ()
 
 setUser (User $user)
 
 logout ()
 

Private Attributes

 $auth
 

Detailed Description

Resolve a user from the API authentication

Definition at line 11 of file UserApiAuthentication.php.

Constructor & Destructor Documentation

◆ __construct()

BristolSU\Support\User\UserApiAuthentication::__construct ( AuthFactory  $auth)
Parameters
AuthFactory$authFactory to resolve the user from

Definition at line 23 of file UserApiAuthentication.php.

References BristolSU\Support\User\UserApiAuthentication\$auth.

Member Function Documentation

◆ getUser()

BristolSU\Support\User\UserApiAuthentication::getUser ( )

Get the user from the API authentication

Returns
User|null Logged in user, or null if no user found.

Implements BristolSU\Support\User\Contracts\UserAuthentication.

Definition at line 33 of file UserApiAuthentication.php.

◆ logout()

BristolSU\Support\User\UserApiAuthentication::logout ( )

Log out of the current user

Returns
void
Exceptions

Implements BristolSU\Support\User\Contracts\UserAuthentication.

Definition at line 59 of file UserApiAuthentication.php.

◆ setUser()

BristolSU\Support\User\UserApiAuthentication::setUser ( User  $user)

Set a user. This method cannot be used since the user cannot be set for an API authentication

Parameters
User$userUser to log in
Returns
void
Exceptions

Implements BristolSU\Support\User\Contracts\UserAuthentication.

Definition at line 48 of file UserApiAuthentication.php.

Member Data Documentation

◆ $auth

BristolSU\Support\User\UserApiAuthentication::$auth
private

The documentation for this class was generated from the following file: