@primocaredentgroup/convex-campaigns-component 0.1.2 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -15,10 +15,15 @@ export const resolveRolesForIdentity = internalQuery({
|
|
|
15
15
|
let user = null;
|
|
16
16
|
|
|
17
17
|
if (args.subject) {
|
|
18
|
-
|
|
19
|
-
.
|
|
20
|
-
|
|
21
|
-
|
|
18
|
+
try {
|
|
19
|
+
// Fallback for hosts where users.by_auth0 is unavailable.
|
|
20
|
+
user = await ctx.db
|
|
21
|
+
.query("users")
|
|
22
|
+
.withIndex("by_auth0", (q) => q.eq("auth0Id", args.subject))
|
|
23
|
+
.first();
|
|
24
|
+
} catch {
|
|
25
|
+
// Ignore index-resolution errors and continue with by_email fallback.
|
|
26
|
+
}
|
|
22
27
|
}
|
|
23
28
|
|
|
24
29
|
if (!user && args.email) {
|
|
@@ -18,11 +18,16 @@ async function resolveCurrentUserWithDb(ctx: AnyCtx) {
|
|
|
18
18
|
if (!identity) return null;
|
|
19
19
|
|
|
20
20
|
if (identity.subject) {
|
|
21
|
-
|
|
22
|
-
.
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
21
|
+
try {
|
|
22
|
+
// Fallback for hosts where users.by_auth0 is unavailable.
|
|
23
|
+
const byAuth0 = await ctx.db
|
|
24
|
+
.query("users")
|
|
25
|
+
.withIndex("by_auth0", (q: any) => q.eq("auth0Id", identity.subject))
|
|
26
|
+
.first();
|
|
27
|
+
if (byAuth0?.isActive) return byAuth0;
|
|
28
|
+
} catch {
|
|
29
|
+
// Ignore index-resolution errors and continue with by_email fallback.
|
|
30
|
+
}
|
|
26
31
|
}
|
|
27
32
|
|
|
28
33
|
if (identity.email) {
|