/** * Checks for a supplied user or uses the default logged in. You should override this method. * @param mixed $user An optional back-end user object. * @return User object */ public function resolveUser($user) { $user = Manager::getUser(); if (!$user) { throw new Exception('User is not logged in'); } return $user; }
/** * Get the currently authenticated user. * * @return \October\Rain\Auth\Models\User */ public function user() { return $this->october->getUser(); }