👔 create callback forwader

create a handler to forward callback requests from the OAuth provider to the main backend system.
This commit is contained in:
2025-08-31 22:02:31 +07:00
parent e804f259b7
commit 2bcd2a4ead
6 changed files with 24 additions and 31 deletions

View File

@ -1,16 +1,13 @@
"use server";
import { api } from "@/shared/api/connector";
export const SendCallbackToServer = async (data: Record<string, any>) => {
export const SendCallbackToServer = async (data: string) => {
try {
const response = await api.get("auth/google/callback", {
searchParams: { ...data },
});
const response = await api.get(`auth/google/callback${data}`);
const result = await response.json();
console.log(result);
return result;
} catch (error) {
console.error("Error sending callback to server:", error);
throw error;
}
};