1
0
mirror of https://github.com/flarum/core.git synced 2025-10-22 12:16:07 +02:00

Improve appearance/behaviour of login/signup/forgot modals

This commit is contained in:
Toby Zerner
2015-05-26 16:25:25 +09:30
parent 5fc2f3aeee
commit 85ba97ed5c
10 changed files with 209 additions and 143 deletions

View File

@@ -21,7 +21,7 @@ class LoginAction extends BaseAction
$response = app('Flarum\Api\Actions\TokenAction')
->handle(new ApiRequest($request->only('identification', 'password')));
if (($data = $response->getData()) && ! empty($data->token)) {
if ($response->getStatusCode() === 200 && ($data = $response->getData()) && ! empty($data->token)) {
$response->withCookie($this->makeRememberCookie($data->token));
event(new UserLoggedIn($this->users->findOrFail($data->userId), $data->token));