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

Automaticy Fill In Redirect Code for New Users #96

Closed
ironhaven opened this issue Oct 22, 2019 · 2 comments · Fixed by #100
Closed

Automaticy Fill In Redirect Code for New Users #96

ironhaven opened this issue Oct 22, 2019 · 2 comments · Fixed by #100

Comments

@ironhaven
Copy link

ironhaven commented Oct 22, 2019

When you first open the program you need to authorize Spotify-tui in your webbrower and copy the redirect URL into the terminal. Because we already have a mock http server that sends a friendly html page it should be easy to retrieve the used callback URL.

Some cursory examination shows that the redirect and terminal input is handed in the rspotify crate.

Steps

  1. Parse http request header and return the URI in from redirect_uri.rs
  2. Call the functions around get_token
@Rigellute
Copy link
Owner

Yes this could be nice improvement!

@jfaltis
Copy link
Contributor

jfaltis commented Oct 22, 2019

I am not that experienced with Rust but I will take a look at it.

ironhaven added a commit to ironhaven/spotify-tui that referenced this issue Sep 19, 2020
This patch is a refactor of the redirect_uri.rs file that boasts various
improvements like less redundant and unnecessary code, more idiomatic patterns
and fewer memory allocations. I created Rigellute#96 and am happy somebody
implemented it.
 #Notes
 * Did you know that TcpStream.flush() is a noop? https://doc.rust-lang.org/src/std/net/tcp.rs.html#606
 * You can create ip ports from tuples like (&str, u16) https://doc.rust-lang.org/std/net/trait.ToSocketAddrs.html
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 a pull request may close this issue.

3 participants