Files
AnimeTV-Frontend/features/oauth-callback/lib/sendCallbackToServer.ts
Rafi Arrafif 2d671b189a 👔 add provider option
Create a provider option in the callback handler to define the provider name for flexibility when used with multiple
providers and requiring multiple endpoints.
2025-08-31 22:45:16 +07:00

14 lines
327 B
TypeScript

"use server";
import { api } from "@/shared/api/connector";
export const SendCallbackToServer = async (data: string, provider: string) => {
try {
const response = await api.get(`auth/${provider}/callback${data}`);
const result = await response.json();
return result;
} catch (error) {
throw error;
}
};