mirror of
https://github.com/BookStackApp/BookStack.git
synced 2026-01-03 23:42:28 +03:00
Added back email confirmation check in middleware
During writing of the update notes, found that the upgrade path would be tricky from a security point of view. If people were pending email confirmation but had an active session, they could technically be actively logged in after the next release. Added middlware as an extra precaution for now.
This commit is contained in:
@@ -459,6 +459,22 @@ class AuthTest extends BrowserKitTest
|
||||
$this->assertFalse($log->hasWarningThatContains('Failed login for admin@admin.com'));
|
||||
}
|
||||
|
||||
public function test_logged_in_user_with_unconfirmed_email_is_logged_out()
|
||||
{
|
||||
$this->setSettings(['registration-confirmation' => 'true']);
|
||||
$user = $this->getEditor();
|
||||
$user->email_confirmed = false;
|
||||
$user->save();
|
||||
|
||||
auth()->login($user);
|
||||
$this->assertTrue(auth()->check());
|
||||
|
||||
$this->get('/books');
|
||||
$this->assertRedirectedTo("/");
|
||||
|
||||
$this->assertFalse(auth()->check());
|
||||
}
|
||||
|
||||
/**
|
||||
* Perform a login.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user