Skip to content
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

Add login command #4509

Merged
merged 22 commits into from
Mar 21, 2023
Merged

Add login command #4509

merged 22 commits into from
Mar 21, 2023

Conversation

montezdesousa
Copy link
Contributor

@montezdesousa montezdesousa commented Mar 17, 2023

Description

  • set in .env OPENBB_ENABLE_AUTHENTICATION='True' to test
  • Also adds enter for guest mode
  • Summary of the change / bug fix.
  • Link # issue, if applicable.
  • Screenshot of the feature or the bug before/after fix, if applicable.
  • Relevant motivation and context.
  • List any dependencies that are required for this change.

How has this been tested?

  • Please describe the tests that you ran to verify your changes.
  • Provide instructions so we can reproduce.
  • Please also list any relevant details for your test configuration.
  • Make sure affected commands still run in terminal
  • Ensure the SDK still works
  • Check any related reports

Checklist:

Others

  • I have performed a self-review of my own code.
  • I have commented my code, particularly in hard-to-understand areas.

@reviewpad reviewpad bot added the feat S Small T-Shirt size Feature label Mar 17, 2023
@montezdesousa montezdesousa marked this pull request as ready for review March 17, 2023 13:50
@jmaslek
Copy link
Collaborator

jmaslek commented Mar 17, 2023

I must have previously used the 'remember me' option, but login when already logged in throws an error:

2023 Mar 17, 10:02 (🦋) /account/ $ login

You are already logged in.



The command 'login' doesn't exist on the / menu.

(if it matters, I overwrote the is_auth_enabled() to always be true)

@jmaslek
Copy link
Collaborator

jmaslek commented Mar 17, 2023

Seems even logging out then in:

2023 Mar 17, 10:04 (🦋) /account/ $ logout

You are currently logged as a guest.
Register: https://my.openbb.dev/register


2023 Mar 17, 10:04 (🦋) /account/ $ login

You are already logged in.



The command 'login' doesn't exist on the / menu.

@reviewpad reviewpad bot added feat M Medium T-Shirt size feature and removed feat S Small T-Shirt size Feature labels Mar 17, 2023
@montezdesousa
Copy link
Contributor Author

I must have previously used the 'remember me' option, but login when already logged in throws an error:

2023 Mar 17, 10:02 (🦋) /account/ $ login

You are already logged in.



The command 'login' doesn't exist on the / menu.

(if it matters, I overwrote the is_auth_enabled() to always be true)

yesss, forgot a not there

@@ -19,7 +19,7 @@ def main():
else:
from openbb_terminal.core.session import session_controller

if is_auth_enabled():
if is_auth_enabled() and ("--login" in sys.argv[1:] or is_installer()):
Copy link
Contributor

Choose a reason for hiding this comment

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

Will installer users need to set the flag in the .env to test the login functionality?

Copy link
Collaborator

Choose a reason for hiding this comment

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

i just make this function return True lol. But until we launch, yeah

@hjoaquim
Copy link
Contributor

This PR also fixes #4302. Well done @montezdesousa !

@codecov
Copy link

codecov bot commented Mar 20, 2023

Codecov Report

❗ No coverage uploaded for pull request base (develop@6b4f0ad). Click here to learn what that means.
Patch has no changes to coverable lines.

Additional details and impacted files
@@            Coverage Diff             @@
##             develop    #4509   +/-   ##
==========================================
  Coverage           ?   55.37%           
==========================================
  Files              ?      585           
  Lines              ?    53215           
  Branches           ?        0           
==========================================
  Hits               ?    29470           
  Misses             ?    23745           
  Partials           ?        0           

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@montezdesousa montezdesousa added this pull request to the merge queue Mar 21, 2023
@montezdesousa montezdesousa merged commit 1a1e8c0 into develop Mar 21, 2023
@montezdesousa montezdesousa deleted the feature/update_login branch March 21, 2023 10:22
jmaslek added a commit that referenced this pull request Apr 13, 2023
* fix show version

* update login prompt and account

* update set preference

* fix account controller

* block login/logout if not called from account

* change conditions to start terminal

* fix required args account model

* add not to login command

* pylint

* accounte controller messages

* set default user when logout

* logout then show menu

* remove unused functions

* fix logging bug

* ruff

* fix account unittests

* fix session unittests

---------

Co-authored-by: James Maslek <jmaslek11@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat M Medium T-Shirt size feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants