mirror of
https://github.com/theroyallab/tabbyAPI.git
synced 2026-03-15 00:07:28 +00:00
Auth: Create keys on different exception
FileNotFoundError is the proper exception to catch here rather than OSError. Signed-off-by: kingbri <bdashore3@proton.me>
This commit is contained in:
@@ -59,7 +59,7 @@ def load_auth_keys(disable_from_config: bool):
|
||||
with open("api_tokens.yml", "r", encoding="utf8") as auth_file:
|
||||
auth_keys_dict = yaml.safe_load(auth_file)
|
||||
AUTH_KEYS = AuthKeys.model_validate(auth_keys_dict)
|
||||
except OSError:
|
||||
except FileNotFoundError:
|
||||
new_auth_keys = AuthKeys(
|
||||
api_key=secrets.token_hex(16), admin_key=secrets.token_hex(16)
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user