Made it possible to pre-fill login via url

Allows email to be passed to email field.
Also allows password only if in demo mode (Due to security concerns).
This commit is contained in:
Dan Brown 2017-12-10 13:56:25 +00:00
parent 3ed5426315
commit 03eb63ec77
No known key found for this signature in database
GPG Key ID: 46D9F943C24A2EF9

View File

@ -102,12 +102,21 @@ class LoginController extends Controller
/**
* Show the application login form.
* @param Request $request
* @return \Illuminate\Http\Response
*/
public function getLogin()
public function getLogin(Request $request)
{
$socialDrivers = $this->socialAuthService->getActiveDrivers();
$authMethod = config('auth.method');
if ($request->has('email')) {
session()->flashInput([
'email' => $request->get('email'),
'password' => (config('app.env') === 'demo') ? $request->get('password', '') : ''
]);
}
return view('auth/login', ['socialDrivers' => $socialDrivers, 'authMethod' => $authMethod]);
}