8000 feat: add auth_port configuration option by EliasA5 · Pull Request #1657 · hrkfdn/ncspot · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

feat: add auth_port configuration option #1657

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
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

EliasA5
Copy link
@EliasA5 EliasA5 commented Jun 14, 2025

Describe your changes

Add a configuration option to set the authenticate port, by default its 8989

Issue ticket number and link

#1637

Checklist before requesting a review

  • Documentation was updated (i.e. due to changes in keybindings, commands, etc.)
  • Changelog was updated with relevant user-facing changes (eg. not dependency updates,
    not performance improvements, etc.)

Copy link
Owner
@hrkfdn hrkfdn left a comment

Choose a reason for hiding this comment

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

Thanks! I was wondering whether the port selection should happen automatically? Another thing I was wondering about whether freely choosing a port is OK? When registering an API client, the user needs to specify a callback URL and I'm uncertain if we can freely choose the port. Did you test this?

Comment on lines 37 to 41
pub fn get_client_redirect_uri(configuration: &Config) -> Result<String, String> {
let auth_port = configuration.values().auth_port.unwrap_or(8989).to_string();
let redirect_url = format!("http://127.0.0.1:{auth_port}/login");
Ok(redirect_url)
}
Copy link
Owner

Choose a reason for hiding this comment

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

Ins 8000 tead of configuring the port, should ncspot pick a free port automatically maybe?

Copy link
Author

Choose a reason for hiding this comment

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

I tried that, if we remove the port it gives back a prompt where you enter the URL manually:

    let redirect_url = format!("http://127.0.0.1/login");
Browse to: https://accounts.spotify.com/authorize?response_type=code&client_id=65b708073fc0480ea92a077233ca87bd&state=TiFVv25QeINX7InxhQjIqA&code_challenge=QLMUWfMSejnKrBxkpqIZu-2RA3EScy25c8xZ1OXmp10&code_challenge_method=S256&redirect_uri=http%3A%2F%2F127.0.0.1%2Flogin&scope=playlist-modify+playlist-modify-private+playlist-modify-public+playlist-read+playlist-read-collaborative+playlist-read-private+streaming+user-follow-modify+user-follow-read+user-library-modify+user-library-read+user-modify+user-modify-playback-state+user-modify-private+user-personalized+user-read-currently-playing+user-read-email+user-read-play-history+user-read-playback-position+user-read-playback-state+user-read-private+user-read-recently-played+user-top-read
Provide redirect URL
hi
Unable to parse redirect URI hi (relative URL without a base)

Copy link
Owner

Choose a reason for hiding this comment

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

Ah, what I meant was have ncspot pick a value for auth_port automatically.

Signed-off-by: Elias Assaf <elyas51000@gmail.com>
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.

2 participants
0