Formatting

This commit is contained in:
Justin Spahr-Summers
2025-01-24 15:23:24 +00:00
parent fce6644e30
commit 0882a3e0e5
7 changed files with 60 additions and 45 deletions

View File

@@ -1,6 +1,6 @@
import { useEffect, useRef } from 'react';
import { handleOAuthCallback } from '../lib/auth';
import { SESSION_KEYS } from '../lib/constants';
import { useEffect, useRef } from "react";
import { handleOAuthCallback } from "../lib/auth";
import { SESSION_KEYS } from "../lib/constants";
const OAuthCallback = () => {
const hasProcessedRef = useRef(false);
@@ -14,12 +14,12 @@ const OAuthCallback = () => {
hasProcessedRef.current = true;
const params = new URLSearchParams(window.location.search);
const code = params.get('code');
const code = params.get("code");
const serverUrl = sessionStorage.getItem(SESSION_KEYS.SERVER_URL);
if (!code || !serverUrl) {
console.error('Missing code or server URL');
window.location.href = '/';
console.error("Missing code or server URL");
window.location.href = "/";
return;
}
@@ -30,8 +30,8 @@ const OAuthCallback = () => {
// Redirect back to the main app with server URL to trigger auto-connect
window.location.href = `/?serverUrl=${encodeURIComponent(serverUrl)}`;
} catch (error) {
console.error('OAuth callback error:', error);
window.location.href = '/';
console.error("OAuth callback error:", error);
window.location.href = "/";
}
};
@@ -45,4 +45,4 @@ const OAuthCallback = () => {
);
};
export default OAuthCallback;
export default OAuthCallback;