r-anime / flairsite

Site for awarding and setting custom flairs
https://flair.r-anime.moe
MIT License
6 stars 1 forks source link

Limit user input for text #2

Closed durinthal closed 3 years ago

durinthal commented 3 years ago

This is mostly to avoid people putting whatever they want.

How I envision it:

The site selected determines a prefix URL that's not editable, e.g. https://anilist.co/user/

To go an extra step further we could try to validate that an account by that name exists on the site selected.

durinthal commented 3 years ago

Site list is already on our rules page even: https://www.reddit.com/r/anime/wiki/rules#wiki_user_flairs

Badspler commented 3 years ago

I think we are on the same page. The current code is a working proof of solution that still needs heavy front-end and workflow cleanup. Bernas mocked up the following design that we are planning to work towards:

01_05_21_11_54_chrome_ScXQE8cMUG

As for URL validation, its something to look into.

Badspler commented 3 years ago

https://github.com/r-anime/flairsite/blob/master/flair/flairparsing.py#L173

Validates user name to only allow what flair-tracker's would allow for their username (or in Kitsu.io case, the URL to the profile).

In addition allows slash ( / ). This is such that MAL/Anilist have a suffix to the url that takes you from profile to anime-watching list. Will allow the user to set it, if the combined character length isn't above 20 characters.

Eg: 'badspler' vs 'badspler/animelist' which would result in either:

https://anilist.co/user/badspler https://anilist.co/user/badspler/animelist