Skip to content

Refactor/login #4583

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

berhili098
Copy link

@berhili098 berhili098 commented May 19, 2025

What This PR Does
This PR refactors the internal login service logic, specifically the runProtected() and _retrieveUserInfo() methods, with the goal of:

  • Improving code readability and maintainability

  • Simplifying control flow

  • Making log messages more actionable and less ambiguous

  • Handling broken or missing credentials more gracefully

❓ Why I'm creating this PR
While trying to authenticate using dart pub login, I encountered this issue:
image

you are logged in as null

This indicated broken or malformed credentials, and the current logging flow was not clear or helpful enough.

Simplify the login command logic by retrieving userInfo once at the beginning of the method. This reduces redundancy and improves code readability.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant