pycon icon indicating copy to clipboard operation
pycon copied to clipboard

Invalid Mastodon handle results in `https://undefined/@username` URL

Open bittner opened this issue 2 years ago • 1 comments

The edit form of a submission (talk or workshop) has a "Mastodon handle" input field.

As someone becoming less experienced with social media every day, I'm tempted to enter only - what I think is - my user name in that field (in my case peterbittner). Interestingly, this results in a URL https://undefined/@peterbittner on the public page of my talk (https://pycon.it/it/event/... below the speaker photo).

Parsing of Mastodon handle

I failed to find the related code in this repository, but it looks like the "handle" content is expected to be of:

  • either https://<platform>@<username>
  • or <username>@<platform>
  • or @<username>@<platform> (which is what is displayed on Mastodon.social below one's name in the user profile)

... and the two parts <platform> and <username> are being parsed out of that string accordingly to then construct the target URL.

Can we add form validation?

Unfortunately, the form doesn't warn you about your potentially wrong handle. It were nice if it would, to avoid https://undefined/@username for everyone.

bittner avatar Mar 15 '23 09:03 bittner

Hello!

Thanks for the report, adding validation is a good idea!

I will have a look later today

marcoacierno avatar Mar 15 '23 12:03 marcoacierno