AuthService
class AuthService
Supports authentication operations.
Methods
Checks if a user is logged in.
Hashes password.
Tests for login attempts and sets session messages when there is a failed attempt or when account is locked.
Creates a session when the user logs in. A new record is added to the user_sessions table and a cookie is created if remember me is selected.
Logs in user from cookie.
Logs user out.
Perform logout operation on current logged in user. The record for the current logged in user is removed from the user_session table and the corresponding cookie is deleted.
Handles upload for profile image.
Details
at line 27
static string
confirm(Input $request)
Gets value of password confirm field. Assumes field value is "confirm".
at line 37
static Users|false|null
currentUser()
Checks if a user is logged in.
at line 51
static string
hashPassword(string $password)
Hashes password.
at line 65
static Login
login(Input $request, Login $loginModel, string $username, bool $mailer = false)
Processes login attempts
at line 105
static Login
loginAttempts(Users $user, Login $loginModel, bool $mailer = false)
Tests for login attempts and sets session messages when there is a failed attempt or when account is locked.
at line 134
static void
loginUser(Users $loginUser, bool $rememberMe = false)
Creates a session when the user logs in. A new record is added to the user_sessions table and a cookie is created if remember me is selected.
at line 169
static Users|null
loginUserFromCookie()
Logs in user from cookie.
at line 186
static void
logout()
Logs user out.
at line 201
static bool
logoutUser(Users $user)
Perform logout operation on current logged in user. The record for the current logged in user is removed from the user_session table and the corresponding cookie is deleted.
at line 222
static void
passwordReset(Input $request, Users $user)
Resets password.
at line 245
static Uploads|null
profileImageUpload(Users $user)
Handles upload for profile image.