mirror of
https://github.com/ankitects/anki.git
synced 2025-09-19 06:22:22 -04:00
Use more secure API key
https://github.com/ankitects/anki/pull/3925#discussion_r2051494659
This commit is contained in:
parent
6cdebd7638
commit
757247d424
1 changed files with 2 additions and 3 deletions
|
@ -7,9 +7,8 @@ import enum
|
|||
import logging
|
||||
import mimetypes
|
||||
import os
|
||||
import random
|
||||
import re
|
||||
import string
|
||||
import secrets
|
||||
import sys
|
||||
import threading
|
||||
import traceback
|
||||
|
@ -765,7 +764,7 @@ def legacy_page_data() -> Response:
|
|||
return _text_response(HTTPStatus.NOT_FOUND, "page not found")
|
||||
|
||||
|
||||
_APIKEY = "".join(random.choices(string.ascii_letters + string.digits, k=32))
|
||||
_APIKEY = secrets.token_urlsafe(32)
|
||||
|
||||
|
||||
def _have_api_access() -> bool:
|
||||
|
|
Loading…
Reference in a new issue