Jolo
Jolo4mo ago

Has anyone an idea how to avoid this Flash when checking if `Authenticated` or `Unauthenticated`?

It could be more of a React thing. My code is looking like this
import { ConvexAuthProvider } from '@convex-dev/auth/react';
import { Authenticated, ConvexReactClient, Unauthenticated } from 'convex/react';

export function App() {
const convex = new ConvexReactClient(import.meta.env.PUBLIC_CONVEX_URL as string);

return (
<ConvexAuthProvider client={convex}>
<Unauthenticated>
<LoginForm />
</Unauthenticated>
<Authenticated>
<div>My Content</div>
</Authenticated>
</ConvexAuthProvider>
);
}
import { ConvexAuthProvider } from '@convex-dev/auth/react';
import { Authenticated, ConvexReactClient, Unauthenticated } from 'convex/react';

export function App() {
const convex = new ConvexReactClient(import.meta.env.PUBLIC_CONVEX_URL as string);

return (
<ConvexAuthProvider client={convex}>
<Unauthenticated>
<LoginForm />
</Unauthenticated>
<Authenticated>
<div>My Content</div>
</Authenticated>
</ConvexAuthProvider>
);
}
0 Replies
No replies yetBe the first to reply to this messageJoin

Did you find this page helpful?