👔 create callback forwader
create a handler to forward callback requests from the OAuth provider to the main backend system.
This commit is contained in:
@ -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;
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user