v0.3.0
Feature update
Add a new isInitialized flag to the logtoContext. This field indicates whether the logtoClient has successfully loaded the authentication status from local storage. Initially set to false, it will be updated to true once the authentication status is fully loaded.
E.g.
const Page = () => {
const {signIn, signOut, isInitialized, isAuthenticated} = useLogto();
if (!isInitialized) {
return "loading...";
}
return isAuthenticated ? <Button title="Sign In" onPress={async () => signIn()} /> : <Button title="Sign out" onPress={async () => signOut()} />
}