Replies: 5 comments
-
Not sure what you mean with ‘there is nothing to do’. The isLoggedIn function that is being exported checks if the refresh tokens are present. If they are, that means that the user is authenticated (given that the tokens are valid) |
Beta Was this translation helpful? Give feedback.
-
I can get the stored token but that function can not set isLoggedIn as true. |
Beta Was this translation helpful? Give feedback.
-
When you store tokens using
I hope this helps. |
Beta Was this translation helpful? Give feedback.
-
`import React, { useState } from 'react'; import { const App = () => { const refreshToken = getRefreshToken().then(refreshToken => console.log(refreshToken)) if(!isLoggedIn() ) { <Button title="Logout" style={styles.button} onPress={() => logout()} /> )} else { return ( <StatusBar barStyle={isDarkMode ? 'light-content' : 'dark-content'} /> <TextInput style={styles.input} placeholder="Email" placeholderTextColor="#fefefe" keyboardType="email-address" autoCapitalize="none" // value={fullName} onChangeText={onChangeNameHandler}
); const styles = StyleSheet.create({ export default App;` Can't get it to work right now. Keep "LoggedIn" alert even in first run. |
Beta Was this translation helpful? Give feedback.
-
I'm sorry, but I can't read your code at all. Would you mind formatting your code properly and removing everything that has nothing to do with authentication? Also keep in mind that isLoggedIn returns a promise. So:
or
|
Beta Was this translation helpful? Give feedback.
-
Hi.
How to get current login state?
There's nothing to do with isLoggedIn function.
Beta Was this translation helpful? Give feedback.
All reactions