feat: rm cookie logic
This commit is contained in:
@@ -29,20 +29,6 @@ export interface IntegrationSettings {
|
||||
data: string;
|
||||
}
|
||||
|
||||
// Helper functions to replace js-cookie functionality
|
||||
const getCookie = (name: string): string | null => {
|
||||
const value = `; ${document.cookie}`;
|
||||
const parts = value.split(`; ${name}=`);
|
||||
if (parts.length === 2) {
|
||||
return parts.pop()?.split(';').shift() || null;
|
||||
}
|
||||
return null;
|
||||
};
|
||||
|
||||
const removeCookie = (name: string): void => {
|
||||
document.cookie = `${name}=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/`;
|
||||
};
|
||||
|
||||
export const IntegrationSettingsModal = ({
|
||||
isOpen,
|
||||
handleStart,
|
||||
@@ -154,17 +140,6 @@ export const IntegrationSettingsModal = ({
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
// Check if there is a success message in cookies
|
||||
const status = getCookie("robot_auth_status");
|
||||
const message = getCookie("robot_auth_message");
|
||||
|
||||
if (status === "success" && message) {
|
||||
notify("success", message);
|
||||
// Clear the cookies after reading
|
||||
removeCookie("robot_auth_status");
|
||||
removeCookie("robot_auth_message");
|
||||
}
|
||||
|
||||
// Check if we're on the callback URL
|
||||
const urlParams = new URLSearchParams(window.location.search);
|
||||
const code = urlParams.get("code");
|
||||
|
||||
Reference in New Issue
Block a user