mirror of
https://github.com/theroyallab/tabbyAPI.git
synced 2026-03-14 15:57:27 +00:00
Auth: Only regenerate auth on OSError
OSError means that a file wasn't found, which means auth tokens should be rengenerated. Otherwise, fire the error and exit. Signed-off-by: kingbri <bdashore3@proton.me>
This commit is contained in:
2
auth.py
2
auth.py
@@ -31,7 +31,7 @@ def load_auth_keys():
|
||||
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 Exception as _:
|
||||
except OSError:
|
||||
new_auth_keys = AuthKeys(
|
||||
api_key = secrets.token_hex(16),
|
||||
admin_key = secrets.token_hex(16)
|
||||
|
||||
Reference in New Issue
Block a user