Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request includes changes to the
aioaquarea
module to improve the authentication process and code readability. The most important changes include the addition of a new constantAQUAREA_SERVICE_AUTH0_CLIENT
, refactoring of therequest
method, introduction of private methods to handle token validation and login process, and the use of the new constant in theasync def _login_production(self) -> None:
method.Here are the key changes:
Changes to constants:
aioaquarea/const.py
: Added a new constantAQUAREA_SERVICE_AUTH0_CLIENT
to store the Auth0 client details.Refactoring of the
request
method:aioaquarea/core.py
: Refactored therequest
method to use a new private method__contains_valid_token
to check if the data contains a valid token. [1] [2]Introduction of private methods:
aioaquarea/core.py
: Introduced new private methods__login_demo
,__login_production
,__complete_login
, and__is_final_step
to handle the login process and check the final step of the login process. [1] [2] [3] [4]Changes to the
async def _login_production(self) -> None:
method:aioaquarea/core.py
: Updated theasync def _login_production(self) -> None:
method to use the new constantAQUAREA_SERVICE_AUTH0_CLIENT
and the newly introduced private methods.