mirror of
https://code.eliotberriot.com/funkwhale/funkwhale.git
synced 2025-10-04 06:49:16 +02:00
See #1039: resend confirmation email on login if email is unverified
This commit is contained in:
parent
372bd4a6ee
commit
b07bd83fa1
9 changed files with 82 additions and 11 deletions
|
@ -43,9 +43,11 @@ class ModelBackend(backends.ModelBackend):
|
|||
return user if self.user_can_authenticate(user) else None
|
||||
|
||||
def user_can_authenticate(self, user):
|
||||
return super().user_can_authenticate(
|
||||
user
|
||||
) and not authentication.should_verify_email(user)
|
||||
can_authenticate = super().user_can_authenticate(user)
|
||||
if authentication.should_verify_email(user):
|
||||
raise authentication.UnverifiedEmail(user)
|
||||
|
||||
return can_authenticate
|
||||
|
||||
|
||||
class AllAuthBackend(auth_backends.AuthenticationBackend, ModelBackend):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue