Skip to content

Conversation

@alejsdev
Copy link
Member

πŸ§‘β€πŸ’» Handle already logged in state

@alejsdev alejsdev marked this pull request as ready for review October 28, 2025 14:42
@alejsdev alejsdev requested a review from patrick91 October 28, 2025 14:42
Comment on lines +88 to +98
if is_logged_in():
with APIClient() as client:
is_valid, email = _verify_token(client)

if is_valid:
with get_rich_toolkit(minimal=True) as toolkit:
toolkit.print(f"Already logged in as [bold]{email}[/bold]")
toolkit.print(
"Run [bold]fastapi logout[/bold] first if you want to switch accounts."
)
return
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I made a PR to avoid doing any HTTP call, we will validate that the token is still valid

#105

(it could be invalid for other reasons, but I think I prefer avoiding doing an HTTP call)

what do you think?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants