loicpennequin / convex-vue

MIT License
11 stars 5 forks source link

Clerk example tries to write to read-only `isAuthenticated` #15

Open ssorallen opened 2 months ago

ssorallen commented 2 months ago

auth.isAuthenticated that is passed to createConvexVue is written by "convex-vue." However in the example in the docs (https://github.com/loicpennequin/convex-vue/tree/master/packages/convex-vue#example-with-auth-using-clerk) it passes a ComputedRef, which is read-only. This causes a warning during runtime.

This is related to #14 because "convex-vue" both uses auth.isAuthenticated as a signal about an external auth library and as communication to indicate when Convex itself is authenticated. It may be easier to reason about if those are two separate values: "external auth is valid, Convex can get token" and "Convex auth is valid" rather than reuse the same isAuthenticated bit.