adminarchitect / core

AdminArchitect - Active Admin for Laravel
http://adminarchitect.com
MIT License
211 stars 66 forks source link

redirect to intended link not used after successful login #68

Closed zoryamba closed 5 years ago

zoryamba commented 5 years ago

Hi everyone. Faced another issue. In Authenticate middleware vendor/adminarchitect/core/src/Middleware/Authenticate.php:53 when user tries to access any admin page without permissions, the response()->redirectGuest() method is fired. It saves the url, which user tried to access, to session url.intended param. But this param is never used in adminarchitect. Also it causes user to be redirected to adminarchitect home_page after logging into main app. I see 2 ways to fix it:

  1. Implement adminarchitect redirector, which will save own url.admin_intended or something like that, not to influence the main app logic.
  2. As first case seem to take a lot of coding and testing, temporary replacing response()->redirectGuest() with simple response()->redirectTo() will fix the issue without breaking anything since adminarchitect does not use intended url to redirect admin user after logging in.