Spaces:
Running
Running
fix
Browse files- open_pr.py +1 -1
open_pr.py
CHANGED
@@ -46,7 +46,7 @@ def open_pr(space_id_or_url: str, oauth_token: gr.OAuthToken | None) -> str:
|
|
46 |
if oauth_token is None:
|
47 |
raise gr.Error("You must be logged in to open a PR. Click on 'Sign in with Huggingface' first.")
|
48 |
token = oauth_token.token
|
49 |
-
if oauth_token.expires_at
|
50 |
raise gr.Error("Token expired. Logout and try again.")
|
51 |
|
52 |
api = HfApi(token=token)
|
|
|
46 |
if oauth_token is None:
|
47 |
raise gr.Error("You must be logged in to open a PR. Click on 'Sign in with Huggingface' first.")
|
48 |
token = oauth_token.token
|
49 |
+
if oauth_token.expires_at < time.time():
|
50 |
raise gr.Error("Token expired. Logout and try again.")
|
51 |
|
52 |
api = HfApi(token=token)
|