/var/www/vhosts/ihelp.ro/httpdocs/vendor/cakedc/users/Docs/Documentation
NameSizeModeActions
Migration/-0755rm
OneTimePasswordAuthenticator/-0755rm
Authentication.md72790644editdlrm
Authorization.md31040644editdlrm
Configuration.md79340644editdlrm
Events.md11220644editdlrm
Extending-the-Plugin.md68270644editdlrm
Installation.md31810644editdlrm
InterceptLoginAction.md14800644editdlrm
Overview.md6580644editdlrm
SocialAuthentication.md61580644editdlrm
Translations.md5770644editdlrm
Two-Factor-Authenticator.md8440644editdlrm
UserHelper.md21110644editdlrm
Yubico-U2F.md5500644editdlrm
Edit: /var/www/vhosts/ihelp.ro/httpdocs/vendor/cakedc/users/Docs/Documentation/InterceptLoginAction.md (1480B)
Intercept Login Action ====================== There is a moment when you may want to intercept the login action to perform some specific login, like redirect user to another url or set user data. A simple way to intercept the login action is by creating a custom middleware, the following example shows how to set user data and redirect to anothe url. ``` checkActionOnRequest('login', $request)) { return $next($request, $response); } if (!$request->getAttribute('session')->read('Auth')) { //do some logic //do more logic $request->getAttribute('session')->write('Auth', $userIdentity); $response = $response->withHeader('Location', '/pages/33'); return $response; } return $next($request, $response); } } ```