]> BookStack Code Mirror - bookstack/commitdiff
Merge branch 'feature/public-login-redirect' of git://github.com/Xiphoseer/BookStack...
authorDan Brown <redacted>
Sat, 14 Mar 2020 17:46:30 +0000 (17:46 +0000)
committerDan Brown <redacted>
Sat, 14 Mar 2020 17:46:30 +0000 (17:46 +0000)
app/Http/Controllers/Auth/LoginController.php
resources/views/common/header.blade.php

index ea584a3b6f0427f92c271fa8924bff4a5796edb9..4c396d3cd3f756af684f0e9c5af579bc3ed9d766 100644 (file)
@@ -76,6 +76,10 @@ class LoginController extends Controller
             ]);
         }
 
+        if ($request->has('intended')) {
+            redirect()->setIntendedUrl($request->get('intended'));
+        }
+
         return view('auth.login', [
           'socialDrivers' => $socialDrivers,
           'authMethod' => $authMethod,
index 524e4a11af000be035e647b7073900fdfa5aef93..3004acf3c0a2f8f157caad1229b7b6c75cfb61cc 100644 (file)
@@ -45,7 +45,7 @@
                         @if(setting('registration-enabled') && config('auth.method') === 'standard')
                             <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())