Skip to content

fix: use URL encoding for password and username#4

Open
lrilling wants to merge 1 commit intomasterfrom
fix/url-encoded-pw
Open

fix: use URL encoding for password and username#4
lrilling wants to merge 1 commit intomasterfrom
fix/url-encoded-pw

Conversation

@lrilling
Copy link
Collaborator

fixes problems with passwords or usernames containing special URL characters

fixes problems with passwords or usernames containing special URL characters
@lrilling lrilling requested review from Copilot and martinste1n June 17, 2025 12:40
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes the URL construction for the openware-config login by ensuring that special characters in the username and password are URL-encoded.

  • Updates type assertions for username and password.
  • Encodes username and password in the login URL to address encoding issues.

if (host && port && username && password) {
const url = `${host}:${port}/api/users/login?username=${username}&password=${password}`;
const url = `${host}:${port}/api/users/login?username=${encodeURIComponent(username)}&password=${encodeURIComponent(password)}`;
console.log("Refreshing session", url);
Copy link

Copilot AI Jun 17, 2025

Choose a reason for hiding this comment

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

Logging the complete URL including encoded credentials may expose sensitive information. Consider removing or redacting sensitive details from the log statement.

Suggested change
console.log("Refreshing session", url);
console.log("Refreshing session at", `${host}:${port}/api/users/login`);

Copilot uses AI. Check for mistakes.
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