mirror of
https://github.com/searxng/searxng.git
synced 2026-07-31 04:11:26 +00:00
[mod] py: cleanup link_token.py
This commit is contained in:
@@ -151,6 +151,6 @@ def get_token() -> str:
|
|||||||
if token:
|
if token:
|
||||||
token = token.decode('UTF-8') # type: ignore
|
token = token.decode('UTF-8') # type: ignore
|
||||||
else:
|
else:
|
||||||
token = ''.join(random.choice(string.ascii_lowercase + string.digits) for _ in range(16))
|
token = ''.join(random.choices(string.ascii_lowercase + string.digits, k=16))
|
||||||
valkey_client.set(TOKEN_KEY, token, ex=TOKEN_LIVE_TIME)
|
valkey_client.set(TOKEN_KEY, token, ex=TOKEN_LIVE_TIME)
|
||||||
return token
|
return token
|
||||||
|
|||||||
Reference in New Issue
Block a user