Skip to content

Commit

Permalink
feat: remove TokenResponse.state
Browse files Browse the repository at this point in the history
  • Loading branch information
aldbr committed Sep 18, 2023
1 parent 55858ef commit f731204
Show file tree
Hide file tree
Showing 12 changed files with 1,099 additions and 699 deletions.
3 changes: 1 addition & 2 deletions src/diracx/cli/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,8 @@ async def login(
raise RuntimeError("Device authorization flow expired")

# Save credentials
credentials_path = get_diracx_preferences().credentials_path
credentials_path.parent.mkdir(parents=True, exist_ok=True)
write_credentials(response)
credentials_path = get_diracx_preferences().credentials_path
print(f"Saved credentials to {credentials_path}")
print("\nLogin successful!")

Expand Down
3 changes: 1 addition & 2 deletions src/diracx/client/_patch.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,9 +168,8 @@ def refresh_token(
token_response = TokenResponse(
access_token=res["access_token"],
expires_in=res["expires_in"],
state=res["state"],
refresh_token=res.get("refresh_token"),
token_type=res.get("token_type"),
refresh_token=res.get("refresh_token"),
)

write_credentials(cast(CoreTokenResponse, token_response))
Expand Down
2 changes: 1 addition & 1 deletion src/diracx/client/aio/_patch.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import json
from types import TracebackType
from pathlib import Path
from typing import Any, List, Optional, cast
from typing import Any, List, Optional
from azure.core.credentials import AccessToken
from azure.core.credentials_async import AsyncTokenCredential
from azure.core.pipeline import PipelineRequest
Expand Down
Loading

0 comments on commit f731204

Please sign in to comment.