Never got Microsoft Sign in working, but we have my auth at least

This commit is contained in:
2025-09-19 11:29:35 -05:00
parent 6249d51311
commit e7cdf7f754
11 changed files with 171 additions and 91 deletions

View File

@@ -10,26 +10,11 @@ import { type Id } from './_generated/dataModel';
import { action, mutation, query } from './_generated/server';
import Password from './CustomPassword';
import Authentik from '@auth/core/providers/authentik';
import MicrosoftEntraID from '@auth/core/providers/microsoft-entra-id';
export const { auth, signIn, signOut, store, isAuthenticated } = convexAuth({
providers: [
Password,
Authentik,
MicrosoftEntraID({
clientId: process.env.AUTH_MICROSOFT_ENTRA_ID_ID!,
clientSecret: process.env.AUTH_MICROSOFT_ENTRA_ID_SECRET!,
// Either a tenant GUID, or "common" / "organizations" / "consumers"
issuer: process.env.AUTH_MICROSOFT_ENTRA_ID_ISSUER!,
// Optional, but providing an object prevents the undefined read:
profilePhotoSize: 48,
// Optional: request email + offline refresh
authorization: {
params: {
scope: 'openid profile email offline_access',
},
},
}),
],
});
@@ -53,7 +38,7 @@ export const getUser = query(async (ctx) => {
name: user.name ?? null,
image,
lunchTime: user.lunchTime ?? null,
automaticLunch: user.automaticLunch ?? (false as boolean),
automaticLunch: user.automaticLunch ?? false,
};
});