mirror of
https://github.com/urosran/cally.git
synced 2025-07-16 01:56:16 +00:00
New onboarding flow, calendar sync logic refactor
This commit is contained in:
@ -1,12 +1,16 @@
|
||||
import {useMutation} from "react-query";
|
||||
import functions, {FirebaseFunctionsTypes} from '@react-native-firebase/functions';
|
||||
import auth from "@react-native-firebase/auth";
|
||||
import {useAuthContext} from "@/contexts/AuthContext";
|
||||
|
||||
export const useLoginWithQrCode = () => {
|
||||
const {setRedirectOverride} = useAuthContext()
|
||||
|
||||
return useMutation({
|
||||
mutationKey: ["loginWithQrCode"],
|
||||
mutationFn: async ({userId}: { userId: string }) => {
|
||||
try {
|
||||
setRedirectOverride(true)
|
||||
const res = await functions().httpsCallable("generateCustomToken")({userId}) as FirebaseFunctionsTypes.HttpsCallableResult<{
|
||||
token: string
|
||||
}>
|
||||
|
Reference in New Issue
Block a user