Commit b6c12647 authored by pramod.nichelabs's avatar pramod.nichelabs

skipped login

parent 07cca18d
...@@ -25,7 +25,7 @@ export function AuthStack({ navigation }) { ...@@ -25,7 +25,7 @@ export function AuthStack({ navigation }) {
<Stack.Navigator> <Stack.Navigator>
<Stack.Screen <Stack.Screen
name="SignIn" name="SignIn"
component={SignIn} component={HomeScreen}
options={{ options={{
// headerLeft: () => { // headerLeft: () => {
// return ( // return (
......
...@@ -126,27 +126,26 @@ export function SignIn({ navigation }) { ...@@ -126,27 +126,26 @@ export function SignIn({ navigation }) {
<TouchableOpacity <TouchableOpacity
style={styles.buttonSub} style={styles.buttonSub}
activeOpacity={0.5} activeOpacity={0.5}
onPress={ () => onPress={ () => navigation.navigate("HomeScreen") }
axios.post("http://192.168.8.126:5000/login", form) // axios.post("http://192.168.8.126:5000/login", form)
.then( async function (response) { // .then( async function (response) {
// const stngobj = JSON.stringify() // // const stngobj = JSON.stringify()
console.log(response.data); // console.log(response.data);
// alert("Successfully Logged in"); // // alert("Successfully Logged in");
await SecureStore.setItemAsync("token", response.data.token); // await SecureStore.setItemAsync("token", response.data.token);
axios.defaults.headers.common = { // axios.defaults.headers.common = {
authorization : response.data.token // authorization : response.data.token
} // }
navigation.navigate("HomeScreen") // navigation.navigate("HomeScreen")
// return response; // // return response;
}) // })
.catch(function (error) { // .catch(function (error) {
console.log(error); // console.log(error);
alert("No User Existed") // alert("No User Existed")
}) // })
}
> >
<Text style={styles.buttonTextStyle}>LOGIN</Text> <Text style={styles.buttonTextStyle}>LOGIN</Text>
{/* <ImageBackground source={require('../assets/loginex.jpg')} style={styles.imagebutton}/> */} {/* <ImageBackground source={require('../assets/loginex.jpg')} style={styles.imagebutton}/> */}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment