mirror of
https://github.com/Drop-OSS/drop.git
synced 2025-11-14 16:51:15 +10:00
feat: openapi support plus more api validation
This commit is contained in:
@ -1,6 +1,14 @@
|
||||
import sessionHandler from "~/server/internal/session";
|
||||
import { enabledAuthManagers } from "~/server/plugins/04.auth-init";
|
||||
|
||||
defineRouteMeta({
|
||||
openAPI: {
|
||||
tags: ["Auth"],
|
||||
description: "OIDC Signin callback",
|
||||
parameters: [],
|
||||
},
|
||||
});
|
||||
|
||||
export default defineEventHandler(async (h3) => {
|
||||
if (!enabledAuthManagers.OpenID) return sendRedirect(h3, "/auth/signin");
|
||||
|
||||
|
||||
@ -1,5 +1,13 @@
|
||||
import { enabledAuthManagers } from "~/server/plugins/04.auth-init";
|
||||
|
||||
defineRouteMeta({
|
||||
openAPI: {
|
||||
tags: ["Auth"],
|
||||
description: "OIDC Signin redirect",
|
||||
parameters: [],
|
||||
},
|
||||
});
|
||||
|
||||
export default defineEventHandler((h3) => {
|
||||
if (!enabledAuthManagers.OpenID) return sendRedirect(h3, "/auth/signin");
|
||||
|
||||
|
||||
@ -1,5 +1,13 @@
|
||||
import sessionHandler from "../../internal/session";
|
||||
|
||||
defineRouteMeta({
|
||||
openAPI: {
|
||||
tags: ["Auth"],
|
||||
description: "Tells server to deauthorize this session",
|
||||
parameters: [],
|
||||
},
|
||||
});
|
||||
|
||||
export default defineEventHandler(async (h3) => {
|
||||
await sessionHandler.signout(h3);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user