mirror of
https://github.com/simple-login/app.git
synced 2025-02-24 15:53:22 +08:00
use "default" hostname if hostname is too short
This commit is contained in:
parent
c012d3686a
commit
6764a4b582
1 changed files with 5 additions and 5 deletions
|
@ -31,6 +31,11 @@ def index():
|
||||||
|
|
||||||
hostname = data.get("hostname")
|
hostname = data.get("hostname")
|
||||||
|
|
||||||
|
# avoid too short custom email prefix
|
||||||
|
if len(hostname) < 3:
|
||||||
|
LOG.d("hostname %s too short", hostname)
|
||||||
|
hostname = "default"
|
||||||
|
|
||||||
# Update api key stats
|
# Update api key stats
|
||||||
api_key.last_used = arrow.now()
|
api_key.last_used = arrow.now()
|
||||||
api_key.times += 1
|
api_key.times += 1
|
||||||
|
@ -54,11 +59,6 @@ def index():
|
||||||
if user.is_premium():
|
if user.is_premium():
|
||||||
LOG.d("create new custom alias %s %s", hostname, user)
|
LOG.d("create new custom alias %s %s", hostname, user)
|
||||||
|
|
||||||
# avoid too short custom email prefix
|
|
||||||
if len(hostname) < 3:
|
|
||||||
LOG.d("hostname %s too short", hostname)
|
|
||||||
hostname = "default"
|
|
||||||
|
|
||||||
# generate a custom email
|
# generate a custom email
|
||||||
found = False
|
found = False
|
||||||
while not found:
|
while not found:
|
||||||
|
|
Loading…
Reference in a new issue