mirror of
https://github.com/AmruthPillai/Reactive-Resume.git
synced 2025-11-23 13:11:27 +10:00
- implement disable_email_auth env var
- add sync crowdin translations github action
This commit is contained in:
24
apps/client/src/services/auth/providers.ts
Normal file
24
apps/client/src/services/auth/providers.ts
Normal file
@ -0,0 +1,24 @@
|
||||
import { AuthProvidersDto } from "@reactive-resume/dto";
|
||||
import { useQuery } from "@tanstack/react-query";
|
||||
|
||||
import { AUTH_PROVIDERS_KEY } from "@/client/constants/query-keys";
|
||||
import { axios } from "@/client/libs/axios";
|
||||
|
||||
export const getAuthProviders = async () => {
|
||||
const response = await axios.get<AuthProvidersDto>(`/auth/providers`);
|
||||
|
||||
return response.data;
|
||||
};
|
||||
|
||||
export const useAuthProviders = () => {
|
||||
const {
|
||||
error,
|
||||
isPending: loading,
|
||||
data: providers,
|
||||
} = useQuery({
|
||||
queryKey: [AUTH_PROVIDERS_KEY],
|
||||
queryFn: getAuthProviders,
|
||||
});
|
||||
|
||||
return { providers, loading, error };
|
||||
};
|
||||
Reference in New Issue
Block a user