update: logout

parent b3ab4668
......@@ -9,6 +9,7 @@ import { Leaderboard } from "../screen/Leaderboard";
import { PriceScreen } from "../screen/PriceScreen";
import { gamification } from "../screen/gamification";
import { AboutUs } from "../screen/AboutUs";
import axios from "axios";
const Stack = createStackNavigator();
......@@ -46,14 +47,6 @@ export function AuthStack({ navigation }) {
options={{
title: "Sign Up Page",
headerTitleAlign: "center",
headerRight: () => {
return (
<MaterialIcons name="logout"
size={30}
color="black"
/>
);
},
}}
/>
<Stack.Screen
......@@ -67,6 +60,18 @@ export function AuthStack({ navigation }) {
<MaterialIcons name="logout"
size={30}
color="black"
onPress={() => axios.get("http://192.168.8.126:5000/logout", )
.then(function (response) {
const stngobj = JSON.stringify(response.data)
console.log(stngobj + "logged out");
console.log("Successfully logged out");
// alert("Successfully Logged out")
navigation.navigate("SignIn")
})
.catch(function (error) {
console.log(error);
alert("Login failed")
})}
/>
);
},
......@@ -83,6 +88,18 @@ export function AuthStack({ navigation }) {
<MaterialIcons name="logout"
size={30}
color="black"
onPress={() => axios.get("http://192.168.8.126:5000/logout", )
.then(function (response) {
const stngobj = JSON.stringify(response.data)
console.log(stngobj + "logged out");
console.log("Successfully logged out");
// alert("Successfully Logged out")
navigation.navigate("SignIn")
})
.catch(function (error) {
console.log(error);
alert("Login failed")
})}
/>
);
},
......@@ -99,6 +116,18 @@ export function AuthStack({ navigation }) {
<MaterialIcons name="logout"
size={30}
color="black"
onPress={() => axios.get("http://192.168.8.126:5000/logout", )
.then(function (response) {
const stngobj = JSON.stringify(response.data)
console.log(stngobj + "logged out");
console.log("Successfully logged out");
// alert("Successfully Logged out")
navigation.navigate("SignIn")
})
.catch(function (error) {
console.log(error);
alert("Login failed")
})}
/>
);
},
......@@ -115,6 +144,18 @@ export function AuthStack({ navigation }) {
<MaterialIcons name="logout"
size={30}
color="black"
onPress={() => axios.get("http://192.168.8.126:5000/logout", )
.then(function (response) {
const stngobj = JSON.stringify(response.data)
console.log(stngobj + "logged out");
console.log("Successfully logged out");
// alert("Successfully Logged out")
navigation.navigate("SignIn")
})
.catch(function (error) {
console.log(error);
alert("Login failed")
})}
/>
);
},
......
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