Skip to content

Commit

Permalink
Team invite url fix when registration disabled (#26950)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
jackHay22 committed Sep 7, 2023
1 parent 30cea70 commit 1a99533
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions services/mailer/mail_team_invite.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ func MailTeamInvite(ctx context.Context, inviter *user_model.User, team *org_mod
inviteRedirect := url.QueryEscape(fmt.Sprintf("/org/invite/%s", invite.Token))
inviteURL := fmt.Sprintf("%suser/sign_up?redirect_to=%s", setting.AppURL, inviteRedirect)

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

Expand Down

0 comments on commit 1a99533

Please sign in to comment.