mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-07-28 17:02:04 +03:00
Prevented auto-login from direct email confirmation actions
Was done for convenience but could potentially be exploited by an attacker using signing up via one of these routes, then forwarding an email confirmation to another user so they unknowingly utilise an account someone else controls. Tweaks the flow of confirming email, and the user invite flow. For #3050
This commit is contained in:
@ -131,8 +131,8 @@ class AuthTest extends TestCase
|
||||
});
|
||||
|
||||
// Check confirmation email confirmation activation.
|
||||
$this->get('/register/confirm/' . $emailConfirmation->token)->assertRedirect('/');
|
||||
$this->get('/')->assertSee($user->name);
|
||||
$this->get('/register/confirm/' . $emailConfirmation->token)->assertRedirect('/login');
|
||||
$this->get('/login')->assertSee('Your email has been confirmed! You should now be able to login using this email address.');
|
||||
$this->assertDatabaseMissing('email_confirmations', ['token' => $emailConfirmation->token]);
|
||||
$this->assertDatabaseHas('users', ['name' => $dbUser->name, 'email' => $dbUser->email, 'email_confirmed' => true]);
|
||||
}
|
||||
|
Reference in New Issue
Block a user