• Illuminate\Contracts\Auth\StatefulGuard
  • Illuminate\Contracts\Auth\Guard

Manager for authentication

Public properties

public string $ipAddress

The IP address of this request

Protected properties

protected Models\User $user

The currently logged in user

protected array $throttle

In memory throttle cache [md5($userId.$ipAddress) => $this->throttleModel]

protected string $userModel

User Model Class

protected string $groupModel

User Group Model Class

protected string $throttleModel

Throttle Model Class

protected bool $useThrottle

Flag to enable login throttling

protected bool $useSession

Internal flag to toggle using the session for the current authentication request

protected bool $requireActivation

Flag to require users to be activated to login

protected string $sessionKey

Key to store the auth session data in

protected bool $viaRemember

Indicates if the user was authenticated via a recaller cookie.

protected static $instance

Public methods

public void __clone()

public void __wakeup()

public Models\User attempt(array $credentials=array(), bool $remember=false)

attempt to authenticate a user using the given credentials.

  • array $credentials - The user login details
  • bool $remember - Store a non-expire cookie for the user

public void authenticate($credentials, $remember=true)

authenticate the given user according to the passed credentials

  • $credentials
  • $remember

public bool check()

Check to see if the user is logged in and activated, and hasn't been banned or suspended.

public void clearThrottleForUserId($userId)

clearThrottleForUserId unsuspends and clears all throttles records for a user

  • $userId

public Models\Throttle createThrottleModel()

Creates an instance of the throttle model

public Models\User createUserModel()

Creates a new instance of the user model

public void extendUserQuery(October\Rain\Database\Builder $query)

Extend the query used for finding the user.


public Models\Throttle findThrottleByLogin(string $loginName, string $ipAddress)

findThrottleByLogin and ip address

  • string $loginName
  • string $ipAddress

public Models\Throttle findThrottleByUserId(integer $userId, string $ipAddress=NULL)

findThrottleByUserId and ip address

  • integer $userId
  • string $ipAddress

public Models\User findUserByCredentials(array $credentials)

Finds a user by the given credentials.

  • array $credentials - The credentials to find a user by

public mixed findUserById(string $id)

Finds a user by the login value.

  • string $id

public mixed findUserByLogin(string $login)

Finds a user by the login value.

  • string $login

public static void forgetInstance()

Forget this singleton's instance if it exists

public mixed getImpersonator()

Get the original user doing the impersonation

public mixed getUser()

Returns the current user, if any.

public bool guest()

Determine if the current user is a guest.

public int|null id()

Get the ID for the currently authenticated user.

public void impersonate($user)

Impersonates the given user and sets properties in the session but not the cookie.

  • $user

public static void instance()

Create a new instance of this singleton.

public bool isImpersonator()

Check to see if the current session is being impersonated

public void login($user, $remember=true)

login the given user and sets properties in the session.

  • $user
  • $remember

public Illuminate\Contracts\Auth\Authenticatable loginUsingId(mixed $id, bool $remember=false)

Log the given user ID into the application.

  • mixed $id
  • bool $remember

public void logout()

Logs the current user out.

public bool once(array $credentials=array())

Log a user into the application without sessions or cookies.

  • array $credentials

public Illuminate\Contracts\Auth\Authenticatable|false onceUsingId(mixed $id)

Log the given user ID into the application without sessions or cookies.

  • mixed $id

public Models\User register(array $credentials, bool $activate=false, bool $autoLogin=true)

Registers a user with the provided credentials with optional flags for activating the newly created user and automatically logging them in

  • array $credentials
  • bool $activate
  • bool $autoLogin

public void setUser($user)

Sets the user

  • $user

public void stopImpersonate()

Stop the current session being impersonated and authenticate as the impersonator again

public Illuminate\Contracts\Auth\Authenticatable|null user()

Get the currently authenticated user.

public bool validate($credentials=array())

validate a user's credentials.

  • $credentials

public bool viaRemember()

Determine if the user was authenticated via "remember me" cookie.

Protected methods

protected void __construct()


protected October\Rain\Database\Builder createUserModelQuery()

Prepares a query derived from the user model.

protected void init()

Initializes the singleton

protected User validateInternal($credentials=array())

validateInternal a user's credentials, method used internally.

  • $credentials

protected boolean validateUserModel($user $user)

Perform additional checks on the user model.

  • $user $user