wip: working, needs some unit tests for auth functions
This commit is contained in:
@@ -2,7 +2,7 @@ import AsyncStorage from '@react-native-async-storage/async-storage';
|
||||
import auth, { FirebaseAuthTypes } from '@react-native-firebase/auth';
|
||||
import { Alert } from 'react-native';
|
||||
|
||||
export const signInWithPhoneNumber = async (phoneNumber: string): Promise<FirebaseAuthTypes.ConfirmationResult | undefined> => {
|
||||
export const handleSignInWithPhoneNumber = async (phoneNumber: string): Promise<FirebaseAuthTypes.ConfirmationResult | undefined> => {
|
||||
if (!phoneNumber) {
|
||||
Alert.alert("Please enter a valid phone number with a country code");
|
||||
return;
|
||||
@@ -39,7 +39,7 @@ export const getCurrentUserToken = async (): Promise<string | null> => {
|
||||
return null;
|
||||
};
|
||||
|
||||
export const signOut = async (): Promise<void> => {
|
||||
export const handleSignOut = async (): Promise<void> => {
|
||||
await AsyncStorage.removeItem('token');
|
||||
auth().signOut()
|
||||
await auth().signOut()
|
||||
}
|
@@ -1,15 +1,15 @@
|
||||
import {
|
||||
signInWithPhoneNumber,
|
||||
handleSignInWithPhoneNumber,
|
||||
confirmCode,
|
||||
onAuthStateChanged,
|
||||
getCurrentUserToken,
|
||||
signOut
|
||||
handleSignOut
|
||||
} from './firebase-auth'
|
||||
|
||||
export {
|
||||
signInWithPhoneNumber,
|
||||
handleSignInWithPhoneNumber,
|
||||
confirmCode,
|
||||
onAuthStateChanged,
|
||||
getCurrentUserToken,
|
||||
signOut
|
||||
handleSignOut
|
||||
}
|
Reference in New Issue
Block a user