-
Notifications
You must be signed in to change notification settings - Fork 6
π§βπ» Handle already logged in state #103
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
Conversation
| 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 |
There was a problem hiding this comment.
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
(it could be invalid for other reasons, but I think I prefer avoiding doing an HTTP call)
what do you think?
patrick91
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
π§βπ» Handle already logged in state