Formatting
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user