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 url to cb login output. #146

Merged
merged 1 commit into from
Dec 7, 2023
Merged

Conversation

abrightwell
Copy link
Member

This came as a request in #139. The gist of it being that there are some use cases where a browser may not be available to the user, e.g. headless or no default browser. Therefore it would be beneficial to present such configurations with a login url instead that can be copy/pasted to a browser of choice.

Though, here, we're taking it one step further an making sure to provide the link regardless of browser availability. Though, in the case of no browser availability, we no longer prompt the user to open one and instead just present the login url.

Example:

> # With browser
> cb login
Press Enter to open a browser to login. (Ctrl+C to quit)
Or visit: <login_url>

> # Without browser
> cb login
To login with Crunchy Bridge, please visit: <login_url>

@abrightwell abrightwell requested a review from a team as a code owner December 5, 2023 15:15
@abrightwell abrightwell force-pushed the abrightwell/login-url branch 4 times, most recently from f364178 to 7ac921e Compare December 5, 2023 17:07
Comment on lines +55 to +65
# it "exits with error message if session is expired" do
# expect(lib_open_mock).to receive(:can_open_browser?).and_return(false)
# expect(client).to receive(:get_session_intent).and_return(
# Factory.session_intent(expires_at: Time.utc - 1.day, session: Factory.session)
# )

# action.call

# expect(action.output.to_s.ends_with?("login error: login timed out\n")).to be_true
# end

Copy link
Member Author

Choose a reason for hiding this comment

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

I commented out this check for the time being as it was causing some unrelated problems in CI. It runs fine locally. It appears that the issues have something to do with the mocking of CB::Lib::Open and something with OpenSSL (I think). But, there isn't anything different from this particular case than others, so I'm not sure what's up with it. So I'm going to continue poking at it and enable it once I've got it working as I know it's passing locally.

Error: SSL_CTX_load_verify_locations: error:80000002:system library::No such file or directory
specs>        OpenSSL::Error: SSL_CTX_load_verify_locations: error:80000002:system library::No such file or directory

This came as a request in #139. The gist of it being that there are some
use cases where a browser may not be available to the user, e.g.
headless or no default browser. Therefore it would be beneficial to
present such configurations with a login url instead that can be
copy/pasted to a browser of choice.

Though, here, we're taking it one step further an making sure to provide
the link regardless of browser availability. Though, in the case of no
browser availability, we no longer prompt the user to open one and
instead just present the login url.

Example:

```
> # With browser
> cb login
Press Enter to open a browser to login. (Ctrl+C to quit)
Or visit: <login_url>

> # Without browser
> cb login
To login with Crunchy Bridge, please visit: <login_url>
```
@abrightwell abrightwell merged commit 6f7b1e7 into main Dec 7, 2023
2 checks passed
@abrightwell abrightwell deleted the abrightwell/login-url branch December 7, 2023 20:02
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