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
11 protected function currentOrLastAttemptedUser(): User
13 $loginService = app()->make(LoginService::class);
14 $user = auth()->user() ?? $loginService->getLastLoginAttemptUser();
17 throw new NotFoundException('A user for this action could not be found');