Want to remove reset password field if provider is not password. almost there

This commit is contained in:
2025-09-19 16:57:59 -05:00
parent fd2999e9bb
commit 45d2461781

View File

@@ -33,28 +33,29 @@ export const getUser = query(async (ctx) => {
typeof user.image === 'string' && user.image.length > 0
? (user.image as Id<'_storage'>)
: null;
const authAccount = await ctx.db
.query('authAccounts')
.withIndex('userIdAndProvider', (q) => q.eq('userId', userId))
.first();
return {
id: user._id,
email: user.email ?? null,
name: user.name ?? null,
email: user?.email,
name: user?.name,
image,
lunchTime: user.lunchTime ?? null,
automaticLunch: user.automaticLunch ?? false,
lunchTime: user?.lunchTime,
automaticLunch: user.automaticLunch,
provider: authAccount?.provider,
};
});
// Add this temporarily to packages/backend/convex/auth.ts
export const debugMicrosoftConfig = action({
args: {},
handler: async (ctx, args) => {
console.log('Microsoft Entra ID Config Debug:', {
issuer: process.env.AUTH_MICROSOFT_ENTRA_ID_ISSUER,
clientId: process.env.AUTH_MICROSOFT_ENTRA_ID_ID,
hasSecret: !!process.env.AUTH_MICROSOFT_ENTRA_ID_SECRET,
secretLength: process.env.AUTH_MICROSOFT_ENTRA_ID_SECRET?.length,
});
return { logged: true };
},
export const getUserAuthAccount = query(async (ctx) => {
const userId = await getAuthUserId(ctx);
if (!userId) return null;
const authAccount = await ctx.db
.query('authAccounts')
.withIndex('userIdAndProvider', (q) => q.eq('userId', userId))
.first();
return authAccount;
});
export const getAllUsers = query(async (ctx) => {