See #1039: resend confirmation email on login if email is unverified

This commit is contained in:
Eliot Berriot 2020-04-01 15:24:40 +02:00
parent 372bd4a6ee
commit b07bd83fa1
No known key found for this signature in database
GPG key ID: 6B501DFD73514E14
9 changed files with 82 additions and 11 deletions

View file

@ -8,8 +8,7 @@ def check(request):
user = request.user
request.user = user.__class__.objects.all().for_auth().get(pk=user.pk)
if authentication.should_verify_email(request.user):
setattr(request, "oauth2_error", {"error": "unverified_email"})
return False
raise authentication.UnverifiedEmail(user)
return True