3 namespace BookStack\Http\Controllers\Auth;
5 use BookStack\Auth\Access\LoginService;
6 use BookStack\Auth\User;
7 use BookStack\Exceptions\NotFoundException;
9 trait HandlesPartialLogins
12 * @throws NotFoundException
14 protected function currentOrLastAttemptedUser(): User
16 $loginService = app()->make(LoginService::class);
17 $user = auth()->user() ?? $loginService->getLastLoginAttemptUser();
20 throw new NotFoundException('A user for this action could not be found');