Skip to content
Merged

fix #239

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions apps/web/src-tauri/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ fn active_nonces() -> &'static Mutex<HashMap<u16, String>> {
/// Find an available port in the range
fn find_available_port() -> Option<u16> {
for port in OAUTH_PORT_MIN..=OAUTH_PORT_MAX {
if TcpListener::bind(format!("127.0.0.1:{}", port)).is_ok() {
if TcpListener::bind(format!("localhost:{}", port)).is_ok() {
return Some(port);
}
}
Expand Down Expand Up @@ -81,7 +81,7 @@ fn start_oauth_server(app: AppHandle) -> Result<(u16, String), String> {
}

// Bind to the port
let listener = TcpListener::bind(format!("127.0.0.1:{}", port))
let listener = TcpListener::bind(format!("localhost:{}", port))
.map_err(|e| format!("Failed to bind port {}: {}", port, e))?;

listener
Expand Down Expand Up @@ -133,7 +133,7 @@ fn start_oauth_server(app: AppHandle) -> Result<(u16, String), String> {

// Build callback URL for frontend
let callback_url = format!(
"http://127.0.0.1:{}?code={}&state={}",
"http://localhost:{}?code={}&state={}",
server_port,
urlencoding::encode(code),
urlencoding::encode(state)
Expand Down
2 changes: 1 addition & 1 deletion apps/web/src/routes/auth/desktop-callback.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ function DesktopCallbackPage() {

for (let i = 0; i < maxRetries; i++) {
try {
const response = await fetch(`http://127.0.0.1:${port}`, {
const response = await fetch(`http://localhost:${port}`, {
method: "POST",
headers: {
"Content-Type": "application/json",
Expand Down