Skip to content

Commit

Permalink
fix: added request token_expiry to authenticate
Browse files Browse the repository at this point in the history
  • Loading branch information
Lash-L committed Feb 27, 2023
1 parent 59c646b commit 33cc388
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/southern_company_api/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,9 @@ async def connect(self) -> None:
async def authenticate(self) -> bool:
"""Determines if you can authenticate with Southern Company with given login"""
self._request_token = await get_request_verification_token(self.session)
self._request_token_expiry = datetime.datetime.now() + datetime.timedelta(
hours=3
)
self._sc = await self._get_sc_web_token()
return True

Expand Down Expand Up @@ -135,6 +138,7 @@ async def _get_sc_web_token(self) -> str:
else:
return sc_data.group(1)
else:
self._sc = None
raise NoScTokenFound("Login request did not return a sc token")

async def _get_southern_jwt_cookie(self) -> str:
Expand Down

0 comments on commit 33cc388

Please sign in to comment.