mirror of
https://github.com/flarum/core.git
synced 2025-08-01 14:10:37 +02:00
Improve appearance/behaviour of login/signup/forgot modals
This commit is contained in:
@@ -10,11 +10,7 @@ class RegisterUserCommandHandler
|
||||
|
||||
public function handle($command)
|
||||
{
|
||||
// Assert the the current user has permission to create a user. In the
|
||||
// case of a guest trying to register an account, this will depend on
|
||||
// whether or not registration is open. If the user is an admin, though,
|
||||
// it will be allowed.
|
||||
$command->forum->assertCan($command->user, 'register');
|
||||
// @todo check whether or not registration is open (config)
|
||||
|
||||
// Create a new User entity, persist it, and dispatch domain events.
|
||||
// Before persistance, though, fire an event to give plugins an
|
||||
|
@@ -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));
|
||||
|
Reference in New Issue
Block a user