-
Notifications
You must be signed in to change notification settings - Fork 110
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 webbrowser with url for the user #136
Conversation
This is @dermesser's decision, but I wanted to chime in with my $0.02. I personally don't like it when applications open urls in my browser. It's very common that I have multiple browser profiles open and the url get's opened in a random one that is usually not the one I want. |
makes sense to make that configureable, googles python api has the display url only and open url in browser thing separately too. I didn't know the |
IMO, it absolutely makes sense to have something in examples/ that demonstrates how to do this. The question would be whether that example creates it's own local trait that people could then copy+paste as a starting point when they want this functionality, or if the I don't have strong feelings either way. The one technical difference is that the latter option would require bringing |
I'll write the example, you're right dragging in the webbrowser dependency and making it more complicated with cfg options is probably less clean of a solution. |
hello @mike-kfed! Thank you for contributing :) As your proposed change already shows, it is very feasible to open the web browser from the delegate. The easiest way to make this convenient in a non-intrusive (for yup-oauth2) way would be:
This is a win-win, I'd say- for users, it's just a few additional lines of code, and for us it is just a Am I overlooking anything? |
… made authenticator_delegate::present_user_url pub
alright here's my first attempt at this. I assume you want a clean git history, but I figured we can play in my current branch until documentation, filenames and so on have been agreed upon. After that I'll make a new PR with a clean history :) |
I don't think |
present_user_url public
good point, I've implemented it now like this |
LGTM |
made a clean pull request, see #139 |
googles python api has that as an option. very convenient as the auth URL doesn't have to be copied from terminal, especially with the installed-app-flow no copy/paste needed, ever.
this is a quickhack showing it works in rust too. I guess you might want to make this optional somehow?
Please let me know how to integrate this for your library.