Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
async function firebaseSignin(email, pass) {
try {
await firebase.auth().signInWithEmailAndPassword(email, pass);
alert("Logged In!");
// Navigate to the Home page
Actions.main({type: ActionConst.RESET});
Actions.calculate();
return true;
} catch (error) {
alert(error.toString());
return false;
}
}
export function * openScreen (action) {
const {screen, options = {}} = action
// Always reset the nav stack when opening a screen by default
// You can override the RESET type in the options passed to the OPEN_SCREEN dispatch
const mergedOptions = {type: ActionConst.RESET, ...options}
yield call(NavigationActions[screen], mergedOptions)
}
/* Routes ==================================================================== */
export default Actions.create(
{/* Auth */}
{AuthScenes}
{/* Main App */}
{/* Drawer Side Menu */}
{/* Tabbar */}
{TabsScenes}
{/* General */}
,
.then(() => {
Actions.intro({ type: ActionConst.RESET });
// Reset the store
dispatch({
type: 'USER_LOGOUT'
});
})
.catch(error => {
checkFirebaseAuth(accessTokenData).then((user) => {
if (user){
Actions.home({type: ActionConst.RESET})
}else{ // user needs to login to get a Facebook auth token
Actions.login({type: ActionConst.RESET})
}
})
})
import TabsScenes from './tabs';
/* Routes ==================================================================== */
export default Actions.create(
{/* Auth */}
{AuthScenes}
{/* Main App */}
{/* Drawer Side Menu */}
{/* Tabbar */}
{TabsScenes}
{/* Chat */}
// Consts and Libs
import {AppConfig} from '@constants/';
// Scenes
import Authenticate from '@containers/auth/AuthenticateContainer';
import AuthWebView from '@containers/auth/WebView';
/* Routes ==================================================================== */
const scenes = (
);
export default scenes;
actions.startLogout().then(() => {
actions.changeUserData({ email: null });
Actions.loginScreen({ type: ActionConst.RESET });
}, error => {
Alert.alert(JSON.stringify(error.message));
const _onPress = () => {
actions.editTodo(id, textValue);
actions.startUpdateTodo(id, 'text', textValue);
Actions.mainScreen({type: ActionConst.RESET});
}
iconSelected="ios-stopwatch" />
);