diff --git a/pkg/api/org_invite.go b/pkg/api/org_invite.go index a0f84ae0c85..7d928501d71 100644 --- a/pkg/api/org_invite.go +++ b/pkg/api/org_invite.go @@ -27,10 +27,6 @@ func GetPendingOrgInvites(c *m.ReqContext) Response { } func AddOrgInvite(c *m.ReqContext, inviteDto dtos.AddInviteForm) Response { - if setting.DisableLoginForm { - return Error(400, "Cannot invite when login is disabled.", nil) - } - if !inviteDto.Role.IsValid() { return Error(400, "Invalid role specified", nil) } @@ -45,6 +41,10 @@ func AddOrgInvite(c *m.ReqContext, inviteDto dtos.AddInviteForm) Response { return inviteExistingUserToOrg(c, userQuery.Result, &inviteDto) } + if setting.DisableLoginForm { + return Error(400, "Cannot invite when login is disabled.", nil) + } + cmd := m.CreateTempUserCommand{} cmd.OrgId = c.OrgId cmd.Email = inviteDto.LoginOrEmail diff --git a/public/app/features/users/state/reducers.ts b/public/app/features/users/state/reducers.ts index d31682e0c45..e9896a28d11 100644 --- a/public/app/features/users/state/reducers.ts +++ b/public/app/features/users/state/reducers.ts @@ -6,7 +6,7 @@ export const initialState: UsersState = { invitees: [] as Invitee[], users: [] as OrgUser[], searchQuery: '', - canInvite: !config.disableLoginForm && !config.externalUserMngLinkName, + canInvite: !config.externalUserMngLinkName, externalUserMngInfo: config.externalUserMngInfo, externalUserMngLinkName: config.externalUserMngLinkName, externalUserMngLinkUrl: config.externalUserMngLinkUrl,