👔 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.
This commit is contained in:
@ -1,9 +1,9 @@
|
||||
"use server";
|
||||
import { api } from "@/shared/api/connector";
|
||||
|
||||
export const SendCallbackToServer = async (data: string) => {
|
||||
export const SendCallbackToServer = async (data: string, provider: string) => {
|
||||
try {
|
||||
const response = await api.get(`auth/google/callback${data}`);
|
||||
const response = await api.get(`auth/${provider}/callback${data}`);
|
||||
const result = await response.json();
|
||||
|
||||
return result;
|
||||
|
||||
Reference in New Issue
Block a user