- Full Post : Authentication in React Native, Easy, Secure, and Reusable solution
- Expo Demo : Demo
obytes / react-native-auth Goto Github PK
View Code? Open in Web Editor NEWAuthentication in React Native, Easy, Secure, and Reusable solution
Authentication in React Native, Easy, Secure, and Reusable solution
Im trying to use it with React Navigation
import { AuthProvider, useAuth } from './auth';
const { status, userToken } = useAuth();
<AuthProvider>
<ApolloProvider client={client}>
<NavigationContainer>
<Stack.Navigator>
{userToken == null ? (
// No token found, user isn't signed in, login screen should be showed
<Stack.Screen name="SignIn" component={SignInScreen} />
) : (
// User is signed in, so should see Home Screen
<Stack.Screen name="Home" component={HomeScreen} />
)
}
</Stack.Navigator>
</NavigationContainer>
</ApolloProvider>
</AuthProvider>
I also display on both screens userToken content.
I see that content of userToken is changing (content jwt token after login, a null after log out), but screen is always the same.
Can you help me with that?
Kind Regards,
Oskar
In the current readme, the full post link points to https://obytes.com/blog/authentication-in-react-native-easy-secure-and-reusable-solution
but since the endpoint has changed, it should now point to https://www.obytes.com/blog/react-native-auth
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.