Jolo
Jolo
CCConvex Community
Created by Jolo on 8/28/2024 in #support-community
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>
);
}
1 replies
CCConvex Community
Created by Jolo on 8/25/2024 in #support-community
Issues when setting up the auth in an existing project
I tried to setup the Convex Auth to an existing react app but run into issues regarding tsconfig configuration. It says:
convex/schema.ts:1:30 - error TS2792: Cannot find module 'convex/server'. Did you mean to set the 'moduleResolution' option to 'node', or to add aliases to the 'paths' option?

1 import { defineSchema } from "convex/server";
~~~~~~~~~~~~~~~
convex/schema.ts:2:28 - error TS2792: Cannot find module '@convex-dev/auth/server'. Did you mean to set the 'moduleResolution' option to 'node', or to add aliases to the 'paths' option?

2 import { authTables } from "@convex-dev/auth/server";
~~~~~~~~~~~~~~~~~~~~~~~~~
convex/tsconfig.json:10:25 - error TS6046: Argument for '--moduleResolution' option must be: 'node', 'classic'.
10 "moduleResolution": "Bundler",
~~~~~~~~~
Found 6 errors.
convex/schema.ts:1:30 - error TS2792: Cannot find module 'convex/server'. Did you mean to set the 'moduleResolution' option to 'node', or to add aliases to the 'paths' option?

1 import { defineSchema } from "convex/server";
~~~~~~~~~~~~~~~
convex/schema.ts:2:28 - error TS2792: Cannot find module '@convex-dev/auth/server'. Did you mean to set the 'moduleResolution' option to 'node', or to add aliases to the 'paths' option?

2 import { authTables } from "@convex-dev/auth/server";
~~~~~~~~~~~~~~~~~~~~~~~~~
convex/tsconfig.json:10:25 - error TS6046: Argument for '--moduleResolution' option must be: 'node', 'classic'.
10 "moduleResolution": "Bundler",
~~~~~~~~~
Found 6 errors.
` Here my codesandbox: https://codesandbox.io/p/devbox/c52yx6?migrateFrom=pkwz3m&embed=1&file=%2Fpackage.json
3 replies
CCConvex Community
Created by Jolo on 8/19/2024 in #support-community
Convex Auth without React?
Is it possible to use Convex Auth, especially with OAuth without React? Every Auth provider from the docs uses React.
8 replies