mirror of https://github.com/LemmyNet/lemmy.git
Don't check verified email when an admin logs in (#3209)
Workaround for instance admins getting locked out when they turn on the email verification requirement without having verified their own email. Co-authored-by: Dessalines <dessalines@users.noreply.github.com>move-cors-default 0.18.0-rc.2
parent
bfc0c0e7d3
commit
dc36d9ed89
|
@ -40,7 +40,11 @@ impl Perform for Login {
|
|||
local_user_view.person.deleted,
|
||||
)?;
|
||||
|
||||
if site_view.local_site.require_email_verification && !local_user_view.local_user.email_verified
|
||||
// Check if the user's email is verified if email verification is turned on
|
||||
// However, skip checking verification if the user is an admin
|
||||
if !local_user_view.person.admin
|
||||
&& site_view.local_site.require_email_verification
|
||||
&& !local_user_view.local_user.email_verified
|
||||
{
|
||||
return Err(LemmyError::from_message("email_not_verified"));
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue