mirror of
https://github.com/Drop-OSS/drop.git
synced 2025-11-09 20:12:10 +10:00
* fix: small merge fixes * feat: initial setup wizard * fix: last few localization items * fix: lint * fix: bump version
20 lines
614 B
TypeScript
20 lines
614 B
TypeScript
import { AuthMec } from "~/prisma/client/enums";
|
|
import aclManager from "~/server/internal/acls";
|
|
import authManager from "~/server/internal/auth";
|
|
|
|
export default defineEventHandler(async (h3) => {
|
|
const allowed = await aclManager.allowSystemACL(h3, ["auth:read", "setup"]);
|
|
if (!allowed) throw createError({ statusCode: 403 });
|
|
|
|
const enabledAuthManagers = authManager.getAuthProviders();
|
|
|
|
const authData = {
|
|
[AuthMec.Simple]: enabledAuthManagers.Simple,
|
|
[AuthMec.OpenID]:
|
|
enabledAuthManagers.OpenID &&
|
|
enabledAuthManagers.OpenID.generateConfiguration(),
|
|
};
|
|
|
|
return authData;
|
|
});
|