Add one-time token login flow and deep-link handling
This commit is contained in:
+3
-1
@@ -12,6 +12,8 @@ export default function App({ navigation, route }) {
|
||||
|
||||
useEffect(() => {
|
||||
getData = async () => {
|
||||
const tokenFromRoute = typeof route?.params?.token === "string" ? route.params.token.trim() : "";
|
||||
if (tokenFromRoute) return;
|
||||
let r = await API.isLoggedIn();
|
||||
if (r) {
|
||||
await API.logout();
|
||||
@@ -22,7 +24,7 @@ export default function App({ navigation, route }) {
|
||||
return () => {
|
||||
|
||||
}
|
||||
}, []);
|
||||
}, [route?.params?.token]);
|
||||
|
||||
return (
|
||||
<SafeAreaView style={styles.container}>
|
||||
|
||||
Reference in New Issue
Block a user