mirror of
https://github.com/simple-login/app.git
synced 2025-02-25 00:03:03 +08:00
Fix available_suffixes_more_info
This commit is contained in:
parent
abb3ec1f05
commit
7915a2abb9
1 changed files with 9 additions and 6 deletions
|
@ -92,15 +92,18 @@ def available_suffixes_more_info(user: User) -> [SuffixInfo]:
|
|||
# for each user domain, generate both the domain and a random suffix version
|
||||
for custom_domain in user_custom_domains:
|
||||
suffix = "@" + custom_domain.domain
|
||||
suffixes.append(SuffixInfo(True, suffix, signer.sign(suffix).decode(), False))
|
||||
suffix_info = SuffixInfo(True, suffix, signer.sign(suffix).decode(), False)
|
||||
|
||||
# put the default domain to top
|
||||
if user.default_alias_custom_domain_id == custom_domain.id:
|
||||
suffixes.insert(0, suffix_info)
|
||||
else:
|
||||
suffixes.append(suffix_info)
|
||||
|
||||
if custom_domain.random_prefix_generation:
|
||||
suffix = "." + random_word() + "@" + custom_domain.domain
|
||||
suffix_info = SuffixInfo(True, suffix, signer.sign(suffix).decode(), False)
|
||||
# put the default domain to top
|
||||
if user.default_alias_custom_domain_id == custom_domain.id:
|
||||
suffixes.insert(0, suffix_info)
|
||||
else:
|
||||
suffixes.append(suffix_info)
|
||||
suffixes.append(suffix_info)
|
||||
|
||||
# then SimpleLogin domain
|
||||
for sl_domain in user.get_sl_domains():
|
||||
|
|
Loading…
Reference in a new issue