Logging in to Admin when email-based login is disabled


(Quincy Larson) #1

I wanted to force all our community’s users to use Github auth instead of allowing for email-based signup. After configuring this, impersonated a user. Once I signed out, I was unable to get back into the admin account.

What’s the best way to regain admin access?


(Khoa Nguyen) #2

You can edit your app.yml file and add your main github email there.
Rebuild your app and login with github


(Kane York) #3

Follow this topic to the “rails console” step, and do this:

> SiteSetting.enable_local_logins = true
> exit
$ exit
# exit

(Quincy Larson) #4

@riking and @thangngoc89

That did the trick! If anyone reading this is using the BitNami instance, here’s a working command to pull up the rails console:

/opt/bitnami/apps/discourse/htdocs/bin/rails c production

Then: SiteSetting.enable_local_logins = true