Skip to content

Commit 1a99533

Browse files
authored
Team invite url fix when registration disabled (#26950)
This is a follow-on to #26550 and fixes the case where the team invite links to the registration page if it is disabled in settings.
1 parent 30cea70 commit 1a99533

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

services/mailer/mail_team_invite.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ func MailTeamInvite(ctx context.Context, inviter *user_model.User, team *org_mod
4646
inviteRedirect := url.QueryEscape(fmt.Sprintf("/org/invite/%s", invite.Token))
4747
inviteURL := fmt.Sprintf("%suser/sign_up?redirect_to=%s", setting.AppURL, inviteRedirect)
4848

49-
if err == nil && user != nil {
50-
// user account exists
49+
if (err == nil && user != nil) || setting.Service.DisableRegistration || setting.Service.AllowOnlyExternalRegistration {
50+
// user account exists or registration disabled
5151
inviteURL = fmt.Sprintf("%suser/login?redirect_to=%s", setting.AppURL, inviteRedirect)
5252
}
5353

0 commit comments

Comments
 (0)