Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allow registration without invite link #2799

Merged

Conversation

stefan0xC
Copy link
Contributor

@stefan0xC stefan0xC commented Oct 5, 2022

if signups are allowed invited users should be able to complete their registration even when they don't have the invite link at hand.

fixes #2800

@stefan0xC stefan0xC force-pushed the allow-registration-without-invite-link branch from 757037d to 1e7f2d5 Compare October 5, 2022 23:29
@@ -121,12 +117,12 @@ async fn register(data: JsonUpcase<RegisterData>, conn: DbConn) -> EmptyResult {
user_org.save(&conn).await?;
}
user
} else if EmergencyAccess::find_invited_by_grantee_email(&email, &conn).await.is_some() {
} else if CONFIG.is_signup_allowed(&email)
|| EmergencyAccess::find_invited_by_grantee_email(&email, &conn).await.is_some()
Copy link
Contributor Author

@stefan0xC stefan0xC Oct 6, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The check for EmergencyAccess might be redundant in practice. I've enabled it because this way it matches the behavior of organization invites. E.g. if you allow invites, invite someone and then disable invites and disallow signup, invited users can still complete their registration. same for emergency access invites. - If we only want that for invites we should drop it to make the logic easier.

src/api/core/accounts.rs Show resolved Hide resolved
Copy link
Collaborator

@BlackDex BlackDex left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is ok.
Unless someone else thinks this still should return an error.
but i think all checks are done correctly and should block signups if they are disabled and the user in question didn't received an invite at all.

src/api/core/accounts.rs Outdated Show resolved Hide resolved
if signups are allowed invited users should be able to complete their
registration even when they don't have the invite link at hand.
@stefan0xC stefan0xC force-pushed the allow-registration-without-invite-link branch from 75de2d7 to aa5a059 Compare October 18, 2022 10:49
@dani-garcia dani-garcia merged commit aa5a059 into dani-garcia:main Oct 19, 2022
@stefan0xC stefan0xC deleted the allow-registration-without-invite-link branch October 19, 2022 20:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Registration cannot be completed without invite link
4 participants