Send Invites button should not be visible if local logins are disabled

AI-generated summary

Send Invites button visibility issue with local logins disabled

JezPez reported a bug where the “Send Invites” button is visible even when enable_local_logins is set to false. This is an issue because the invite feature relies on local logins. JezPez provided a screenshot of the problem and mentioned that there are no console errors or error logs.

tshenry attempted to reproduce the issue but was unable to do so. However, JezPez clarified that the site has OAuth enabled through a plugin, which sets enable_local_logins to false. When this setting is reverted to true, the pending invites appear.

JezPez concluded that the bug is that the “Invite Users” button should be hidden when enable_local_logins is false.

The issue was fixed by techAPJ through a commit to the Discourse repository.

No console errors, no error logs.

I’m also not sure what the experience is supposed to be? Is a modal supposed to appear?

Thanks guys.

EDIT: We have enable_local_logins: false. As the invite feature needs local logins, this Send Invites button shouldn’t be visible if enable_local_logins: false

2 Likes

I’m not able to reproduce this. When you click on the “Send Invites” button in the admin panel, it should take you to /u/jesse/invited/pending. Though, it doesn’t look like you even have an “Invites” tab on your user profile.

Is there any change in behavior when trying the same thing in safe mode? Have you enabled SSO out of curiosity?

3 Likes

We only have OAuth enabled through the plugin. So we have the site setting enable_local_logins: false

When I set this back to true, the pending invites appear.

This makes sense to me now. How could Discourse invite people if its own local logins are disabled?

The bug is that the Invite Users button should be hidden if enable_local_logins: false.

2 Likes

Fixed via:

https://github.com/discourse/discourse/commit/bd084b21475709d4932bca94f69f48cf2a9f70df

Thanks for reporting this issue, @JezPez :+1:

9 Likes