mirror of
https://github.com/simple-login/app.git
synced 2025-02-24 07:43:54 +08:00
support dot in alias prefix
This commit is contained in:
parent
e74dbd7e98
commit
ceacf8e3a7
5 changed files with 9 additions and 12 deletions
|
@ -221,8 +221,8 @@ def nb_email_log_for_mailbox(mailbox: Mailbox):
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
# Only lowercase letters, numbers, dashes (-) and underscores (_) are currently supported
|
# Only lowercase letters, numbers, dots (.), dashes (-) and underscores (_) are currently supported
|
||||||
_ALIAS_PREFIX_PATTERN = r"[0-9a-z-_]{1,}"
|
_ALIAS_PREFIX_PATTERN = r"[0-9a-z-_.]{1,}"
|
||||||
|
|
||||||
|
|
||||||
def check_alias_prefix(alias_prefix) -> bool:
|
def check_alias_prefix(alias_prefix) -> bool:
|
||||||
|
|
|
@ -31,15 +31,12 @@
|
||||||
<input name="prefix" class="form-control"
|
<input name="prefix" class="form-control"
|
||||||
id="prefix"
|
id="prefix"
|
||||||
type="text"
|
type="text"
|
||||||
pattern="[0-9a-z-_]{1,}"
|
pattern="[0-9a-z-_.]{1,}"
|
||||||
maxlength="40"
|
maxlength="40"
|
||||||
title="Only lowercase letters, numbers, dashes (-) and underscores (_) are currently supported."
|
title="Only lowercase letters, dots, numbers, dashes (-) and underscores (_) are currently supported."
|
||||||
placeholder="Email alias, for example newsletter-123_xyz"
|
placeholder="Alias prefix, for example newsletter.com-123_xyz"
|
||||||
autofocus required>
|
autofocus required>
|
||||||
<div class="small-text">
|
|
||||||
Only lowercase letters, numbers, dashes (-) and underscores (_) are currently supported.
|
|
||||||
Cannot be more than 40 letters.
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -124,7 +124,7 @@ def custom_alias():
|
||||||
|
|
||||||
if not check_alias_prefix(alias_prefix):
|
if not check_alias_prefix(alias_prefix):
|
||||||
flash(
|
flash(
|
||||||
"Only lowercase letters, numbers, dashes (-) and underscores (_) "
|
"Only lowercase letters, numbers, dashes (-), dots (.) and underscores (_) "
|
||||||
"are currently supported for alias prefix. Cannot be more than 40 letters",
|
"are currently supported for alias prefix. Cannot be more than 40 letters",
|
||||||
"error",
|
"error",
|
||||||
)
|
)
|
||||||
|
|
|
@ -103,7 +103,7 @@
|
||||||
type="text"
|
type="text"
|
||||||
pattern="[0-9a-z-_]{1,}"
|
pattern="[0-9a-z-_]{1,}"
|
||||||
maxlength="40"
|
maxlength="40"
|
||||||
title="Only lowercase letters, numbers, dashes (-) and underscores (_) are currently supported."
|
title="Only lowercase letters, dots, numbers, dashes (-) and underscores (_) are currently supported."
|
||||||
placeholder="email alias"
|
placeholder="email alias"
|
||||||
autofocus>
|
autofocus>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -157,7 +157,7 @@ def authorize():
|
||||||
|
|
||||||
if not check_alias_prefix(alias_prefix):
|
if not check_alias_prefix(alias_prefix):
|
||||||
flash(
|
flash(
|
||||||
"Only lowercase letters, numbers, dashes (-) and underscores (_) "
|
"Only lowercase letters, numbers, dashes (-), dots (.) and underscores (_) "
|
||||||
"are currently supported for alias prefix. Cannot be more than 40 letters",
|
"are currently supported for alias prefix. Cannot be more than 40 letters",
|
||||||
"error",
|
"error",
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in a new issue