From c84db0dacaa48c8fb2bec84c679d4292667d6b3a Mon Sep 17 00:00:00 2001 From: Stefan Melmuk <509385+stefan0xC@users.noreply.github.com> Date: Tue, 17 Jun 2025 11:15:36 +0200 Subject: [PATCH] allow signup for invited users (#5967) invited users (e.g. via /admin panel or org invite) should be able to register if email is disabled. --- src/api/identity.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/api/identity.rs b/src/api/identity.rs index 9aba23d2..6a6e52fc 100644 --- a/src/api/identity.rs +++ b/src/api/identity.rs @@ -718,7 +718,10 @@ async fn register_verification_email( ) -> ApiResult { let data = data.into_inner(); - if !CONFIG.is_signup_allowed(&data.email) { + // the registration can only continue if signup is allowed or there exists an invitation + if !(CONFIG.is_signup_allowed(&data.email) + || (!CONFIG.mail_enabled() && Invitation::find_by_mail(&data.email, &mut conn).await.is_some())) + { err!("Registration not allowed or user already exists") }