Skip to content

Commit d596e06

Browse files
committed
check if require_email_verification is set in Authenticator and sign-in page
1 parent 18e0951 commit d596e06

3 files changed

Lines changed: 6 additions & 3 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
- Fix issue with scopes being applied twice in Unique::getPaginatedQuery (https://github.com/userfrosting/extend-user/issues/2)
55
- Update Bower dependencies in core Sprinkle
66
- Refactor the `Password` class to use `hash_equals` for legacy passwords (prevent timing-based attacks) and factor out the default cost (#814)
7+
- Check if require_email_verification is set in Authenticator and sign-in page (#815)
78

89
## v4.1.13-alpha
910
- `ufTable`: Implement `rowTemplate` for customizing how rows are rendered (#787)

app/sprinkles/account/src/Authenticate/Authenticator.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,8 +143,8 @@ public function attempt($identityColumn, $identityValue, $password, $rememberMe
143143
throw new AccountDisabledException();
144144
}
145145

146-
// Check that the user's account is activated
147-
if ($user->flag_verified == 0) {
146+
// Check that the user's account is verified (if verification is required)
147+
if ($this->config['site.registration.require_email_verification'] && $user->flag_verified == 0) {
148148
throw new AccountNotVerifiedException();
149149
}
150150

app/sprinkles/account/templates/pages/sign-in.html.twig

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,9 @@
4848
</form>
4949

5050
<a href="{{site.uri.public}}/account/forgot-password">{{translate('PASSWORD.FORGET')}}</a><br>
51-
<a href="{{site.uri.public}}/account/resend-verification">{{translate('ACCOUNT.VERIFICATION.RESEND')}}</a><br>
51+
{% if site.registration.require_email_verification %}
52+
<a href="{{site.uri.public}}/account/resend-verification">{{translate('ACCOUNT.VERIFICATION.RESEND')}}</a><br>
53+
{% endif %}
5254
{% if site.registration.enabled %}
5355
<a href="{{site.uri.public}}/account/register">{{translate('REGISTER')}}</a>
5456
{% endif %}

0 commit comments

Comments
 (0)