Checkpoint: Connexion Microsoft 365 (Azure AD OAuth2) : migration DB azureAdId, helpers backend, route callback, bouton Login, page AzureCallback, tests OK
This commit is contained in:
@@ -35,6 +35,7 @@ import {
|
||||
import { importVeille, importAAP, runFullImport, getImportConfig } from "./importer";
|
||||
import { scheduleDailyImport } from "./_core/index";
|
||||
import { loginLocalUser, hashPassword, ensureAdminExists } from "./localAuth";
|
||||
import { isAzureAdConfigured, getAzureAuthUrl } from "./azureAuth";
|
||||
import { classifyArticle } from "./aiClassifier";
|
||||
import { getDb } from "./db";
|
||||
import { veilleItems, aapItems, articleReads, processedDedupKeys } from "../drizzle/schema";
|
||||
@@ -80,6 +81,17 @@ export const appRouter = router({
|
||||
ctx.res.clearCookie("veille_local_auth", { ...cookieOptions, maxAge: -1 });
|
||||
return { success: true };
|
||||
}),
|
||||
// Azure AD
|
||||
isAzureAdAvailable: publicProcedure.query(() => {
|
||||
return { available: isAzureAdConfigured() };
|
||||
}),
|
||||
getAzureLoginUrl: publicProcedure.query(async () => {
|
||||
if (!isAzureAdConfigured()) {
|
||||
throw new TRPCError({ code: "BAD_REQUEST", message: "Azure AD non configur\u00e9" });
|
||||
}
|
||||
const url = await getAzureAuthUrl();
|
||||
return { url };
|
||||
}),
|
||||
}),
|
||||
|
||||
// ─── Veille ─────────────────────────────────────────────────────────────────
|
||||
|
||||
Reference in New Issue
Block a user