Skip to content

Commit

Permalink
fix error
Browse files Browse the repository at this point in the history
  • Loading branch information
IAmMoltony committed Feb 12, 2025
1 parent 092a563 commit 2377232
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,12 @@ def get_new_access_token():
)

data = response.json()
dotenv.set_key(".env", "ACCESS_TOKEN", data["access_token"])
dotenv.set_key(".env", "REFRESH_TOKEN", data["refresh_token"])
dotenv.load_dotenv()
new_access_token = data["access_token"]
new_refresh_token = data["refresh_token"]
dotenv.set_key(".env", "ACCESS_TOKEN", new_access_token)
dotenv.set_key(".env", "REFRESH_TOKEN", new_refresh_token)
os.environ["ACCESS_TOKEN"] = new_access_token
os.environ["REFRESH_TOKEN"] = new_refresh_token

def handle_oauth_error(api):
logging.getLogger().info("Refreshing access token")
Expand Down

0 comments on commit 2377232

Please sign in to comment.