try {
$this->emailConfirmationService->sendConfirmation($newUser);
+ session()->flash('sent-email-confirmation', true);
} catch (Exception $e) {
$message = trans('auth.email_confirm_send_error');
throw new UserRegistrationException($message, '/register/confirm');
], 401);
}
+ if (session()->get('sent-email-confirmation') === true) {
+ return redirect('/register/confirm');
+ }
+
return redirect('/register/confirm/awaiting');
}
}
->seePageIs('/register/confirm')
->seeInDatabase('users', ['name' => $user->name, 'email' => $user->email, 'email_confirmed' => false]);
+ $this->visit('/')
+ ->seePageIs('/register/confirm/awaiting');
+
+ auth()->logout();
+
$this->visit('/')->seePageIs('/login')
->type($user->email, '#email')
->type($user->password, '#password')
->seePageIs('/register/confirm')
->seeInDatabase('users', ['name' => $user->name, 'email' => $user->email, 'email_confirmed' => false]);
+ $this->visit('/')
+ ->seePageIs('/register/confirm/awaiting');
+
+ auth()->logout();
$this->visit('/')->seePageIs('/login')
->type($user->email, '#email')
->type($user->password, '#password')
]
]]);
- $this->mockUserLogin()->seePageIs('/register/confirm/awaiting');
+ $this->mockUserLogin()->seePageIs('/register/confirm');
$this->seeInDatabase('users', [
'email' => $user->email,
'email_confirmed' => false,
$this->withPost(['SAMLResponse' => $this->acsPostData], function () use ($memberRole, $adminRole) {
$acsPost = $this->followingRedirects()->post('/saml2/acs');
- $acsPost->assertSee('Your email address has not yet been confirmed');
+
+ $this->assertEquals('http://localhost/register/confirm', url()->current());
+ $acsPost->assertSee('Please check your email and click the confirmation button to access BookStack.');
$user = User::query()->where('external_auth_id', '=', 'user')->first();
$userRoleIds = $user->roles()->pluck('id');