mirror of
https://github.com/simple-login/app.git
synced 2024-09-21 07:25:59 +08:00
improve custom alias check
This commit is contained in:
parent
3f2f2cabf4
commit
539bf56e97
|
@ -72,10 +72,11 @@ def custom_alias():
|
|||
|
||||
def verify_prefix_suffix(user, alias_prefix, alias_suffix, user_custom_domains) -> bool:
|
||||
"""verify if user could create an alias with the given prefix and suffix"""
|
||||
if not alias_prefix or not alias_suffix: # should be caught on frontend
|
||||
return False
|
||||
|
||||
alias_prefix = alias_prefix.strip()
|
||||
alias_prefix = convert_to_id(alias_prefix)
|
||||
if not alias_prefix: # should be caught on frontend
|
||||
return False
|
||||
|
||||
# make sure alias_suffix is either .random_word@simplelogin.co or @my-domain.com
|
||||
alias_suffix = alias_suffix.strip()
|
||||
|
|
Loading…
Reference in a new issue