]> BookStack Code Mirror - bookstack/commitdiff
Recall previous route when manually clicking login 1817/head
authorDaniel Seiler <redacted>
Sat, 14 Dec 2019 07:16:48 +0000 (08:16 +0100)
committerDaniel Seiler <redacted>
Sat, 14 Dec 2019 07:41:22 +0000 (08:41 +0100)
app/Http/Controllers/Auth/LoginController.php
resources/views/common/header.blade.php

index b1d22d57e1f892a7068f66dd90c6cd0acceb7715..639da6699647e8f2a133f7cfc09b7bb25bd4a36a 100644 (file)
@@ -128,6 +128,10 @@ class LoginController extends Controller
             ]);
         }
 
+        if ($request->has('intended')) {
+            redirect()->setIntendedUrl($request->get('intended'));
+        }
+
         return view('auth.login', [
           'socialDrivers' => $socialDrivers,
           'authMethod' => $authMethod,
index 19299695042e98ded5b55735865c31f6fee9528b..2d3871ba06f865bc13cef7160394dc12b4abf407 100644 (file)
@@ -45,7 +45,7 @@
                         @if(setting('registration-enabled', false))
                             <a href="{{ url('/register') }}">@icon('new-user') {{ trans('auth.sign_up') }}</a>
                         @endif
-                        <a href="{{ url('/login') }}">@icon('login') {{ trans('auth.log_in') }}</a>
+                        <a href="{{ action('Auth\LoginController@getLogin', ['intended' => url()->current()]) }}">@icon('login') {{ trans('auth.log_in') }}</a>
                     @endif
                 </div>
                 @if(signedInUser())