Force Discourse username to match Twitter username?


(TheLoneCuber) #1

On a brand new Discourse instance, with no users yet, I want to use Twitter login only, and I want to force the Discourse username to match the Twitter username. Discourse already automatically populates the new usernames as their logged-in Twitter username. So is there any way to remove the users’ ability to edit their Discourse username when creating a new account?

Or is their any other way I can achieve this?


(TheLoneCuber) #2

Follow Up

I’ve hidden the Name and Username form fields via CSS, which is hacky, but seems to work. I’ve left only the email input box visible which will mean that most users will be created as their Twitter username.


(Benjamin Kampmann) #3

FYI, You will run into the problem that twitter usernames can be changed (and people do that)…


(TheLoneCuber) #4

Yes I’m sure it’ll probably cause me grief down the track, as will old/recycled Twitter usernames, and I haven’t even thought about work-arounds yet. But the Twitter-only sign-in comes some benefits too IMO…

  1. Limits username impersonation and squatting
  2. Acts as a social verification of new users for your existing Discourse community
  3. Makes new users accountable: people can’t just sign-up with any random/anonymous username and be a jerk, or post spam, or discredit other users. They can certainly still do all these things, but they have to do it using their known social identity.

I’ll have an pinned post on-site where users can request their Discourse name to be changed in-line with their changed Twitter name. Time will tell if this Twitter-only sign-in is a very bad idea, but I’m drawn to the positives for now.


Please visit our Discourse Forum! (Directory)
(TheLoneCuber) #5

I’m now using Twitter-only login on sockheight.com, which is a brand new website with very little traffic so far, and even fewer user registrations. I still stand by the Twitter-only login idea and am willing to trial it for the reasons I’ve mentioned above. Feel free to test it for me, and/or leave your thoughts on the matter.