Spiced
Spiced
CCConvex Community
Created by Sexy on 2/18/2024 in #support-community
Validation problem
Shouldn't the id args just be v.string()?
26 replies
CCConvex Community
Created by Spiced on 2/18/2024 in #general
Creating a auth role system with Convex
Thank you in advance!
5 replies
CCConvex Community
Created by Spiced on 2/18/2024 in #general
Creating a auth role system with Convex
Moreover, when im doing
const { isAuthenticated, isLoading } = useConvexAuth();
if (isLoading) {
return (
<div className="flex h-screen items-center justify-center">
<Spinner size={"xl"} />
</div>
);
}

if (!isAuthenticated) {
return redirect("/");
}
const { isAuthenticated, isLoading } = useConvexAuth();
if (isLoading) {
return (
<div className="flex h-screen items-center justify-center">
<Spinner size={"xl"} />
</div>
);
}

if (!isAuthenticated) {
return redirect("/");
}
Is there a way to build upon this?
5 replies
CCConvex Community
Created by Spiced on 2/18/2024 in #general
Creating a auth role system with Convex
@oscklm Hey, thank you for the very thourough explanation. can i just have a shema like so:
// schema.ts
users: defineTable({
tokenIdentifier: v.string(),
roles: v.array(v.string()), // example ["CanEditPosts", "CanDeletePosts"]
}).index("by_token", ["tokenIdentifier"]),
// schema.ts
users: defineTable({
tokenIdentifier: v.string(),
roles: v.array(v.string()), // example ["CanEditPosts", "CanDeletePosts"]
}).index("by_token", ["tokenIdentifier"]),
I'm already using clerk.
5 replies
CCConvex Community
Created by Spiced on 2/16/2024 in #support-community
Custom FilterIf Function
Got the hang of the custom queries although got lost after i understood custom mutations and queries
82 replies
CCConvex Community
Created by Spiced on 2/16/2024 in #support-community
Custom FilterIf Function
I mean i understand, its just a small challenge for me
82 replies
CCConvex Community
Created by Spiced on 2/16/2024 in #support-community
Custom FilterIf Function
var list = context.Obj.Where(o => A.HasValue ? o.a == A : true);
var list = context.Obj.Where(o => A.HasValue ? o.a == A : true);
82 replies