Disabled local logins, locked out of site

(Don Glover) #1

Was configuring and testing social logins and had disable local user account. Logged out to test. Now it appears that I can’t log in back in to using the local admin. Is there a way to force it? If not what are my options?

(Jens Maier) #2

You can use the console to fix this.

  1. SSH into your server.
  2. If you’ve followed the official install guide, run cd /var/discourse; ./launcher enter app.
    If you are running a custom Discourse setup (e.g. not based on Docker), do whatever you need to do to get into your Discourse’s production environment.
  3. Run rails c. You’re now in the Rails console; everything from here on is parsed as Ruby commands.
  4. Type:
    SiteSetting.enable_local_logins = true
  5. exit from the container. Local logins should now be reenabled.

Login/Sign up modals empty
(Don Glover) #3

Thanks for the reply!
I am using Discourse hosted by Discourse, so I don’t have any credential information to ssh into the server. (Unless there is something I missed along the way)

(Jens Maier) #4

Ah, I see. In that case, you may need to get @codinghorror’s or @sam’s attention to help you out.

(Jeff Atwood) #5

Which site is it? Email us at team@discourse.org

(Don Glover) #6

Email sent as requested.

(Don Glover) #7

Now that the issue is resolved. I have given a non local account administrator rights. I should, theoretically, be able to turn off local accounts, correct?

(Jeff Atwood) #8

Sure give it a shot, any issues, email us.

(Don Glover) #9

Thanks. Looks like everything is good now.

(Jeff Atwood) #10

There is also /users/admin-login now for login bypass if you get locked out due to Site Setting mistakes.