mirror of
https://github.com/i701/sarlink-portal.git
synced 2025-07-02 09:48:22 +00:00
refactor: enhance authentication and signup flow with new providers, update middleware matcher, and improve type safety for API responses
This commit is contained in:
@ -46,3 +46,21 @@ export async function logout({ token }: { token: string }) {
|
||||
// Since the API endpoint returns 204 No Content on success, we don't need to parse JSON
|
||||
return null; // Return null to indicate a successful logout with no content
|
||||
}
|
||||
|
||||
export async function checkIdOrPhone({
|
||||
id_card,
|
||||
phone_number,
|
||||
}: { id_card?: string; phone_number?: string }) {
|
||||
console.log("id_card and phone_number", { id_card, phone_number });
|
||||
const response = await fetch(
|
||||
`${process.env.SARLINK_API_BASE_URL}/api/auth/users/filter/?id_card=${id_card}&mobile=${phone_number}`,
|
||||
{
|
||||
method: "GET",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
},
|
||||
);
|
||||
const data = await response.json();
|
||||
return data;
|
||||
}
|
||||
|
Reference in New Issue
Block a user