1
0
mirror of https://github.com/flarum/core.git synced 2025-07-20 16:21:18 +02:00

Remember checkbox (#1075)

* Add session option to Rememberer class

* Update session login function to allow send additional data

* Add Remember me checkbox

* Cleanup login modal
This commit is contained in:
Sajjad Hashemian
2016-11-29 11:02:12 +03:30
committed by Toby Zerner
parent 7af4b8d45f
commit 06c32b668d
7 changed files with 77 additions and 45 deletions

View File

@@ -66,7 +66,8 @@ class LogInController implements ControllerInterface
public function handle(Request $request)
{
$actor = $request->getAttribute('actor');
$params = array_only($request->getParsedBody(), ['identification', 'password']);
$body = $request->getParsedBody();
$params = array_only($body, ['identification', 'password']);
$response = $this->apiClient->send(TokenController::class, $actor, [], $params);
@@ -80,7 +81,7 @@ class LogInController implements ControllerInterface
event(new UserLoggedIn($this->users->findOrFail($data->userId), $token));
$response = $this->rememberer->remember($response, $token);
$response = $this->rememberer->remember($response, $token, ! array_get($body, 'remember'));
}
return $response;