fix: improve role assignment logic and permission handling in dashboard components
This commit is contained in:
@@ -6,7 +6,9 @@ import { query } from "./_generated/server";
|
||||
import { betterAuth } from "better-auth";
|
||||
import schema from "./betterAuth/schema";
|
||||
|
||||
const siteUrl = process.env.SITE_URL!;
|
||||
// Configurações de ambiente para produção
|
||||
const siteUrl = process.env.SITE_URL || process.env.CONVEX_SITE_URL || "http://localhost:5173";
|
||||
const authSecret = process.env.BETTER_AUTH_SECRET;
|
||||
|
||||
// The component client has methods needed for integrating Convex with Better Auth,
|
||||
// as well as helper methods for general use.
|
||||
@@ -21,6 +23,8 @@ export const createAuth = (
|
||||
{ optionsOnly } = { optionsOnly: false }
|
||||
) => {
|
||||
return betterAuth({
|
||||
// Secret para criptografia de tokens - OBRIGATÓRIO em produção
|
||||
secret: authSecret,
|
||||
// disable logging when createAuth is called just to generate options.
|
||||
// this is not required, but there's a lot of noise in logs without it.
|
||||
logger: {
|
||||
|
||||
Reference in New Issue
Block a user