Fixed 267U.pre2

This commit is contained in:
2026-07-26 18:25:37 +09:00
parent 50bfaeafdf
commit 317d00a284
1286 changed files with 80222 additions and 1 deletions
@@ -0,0 +1,24 @@
import { AuthHelpers } from "../helpers/auth.js";
import { MiAuth } from "../middleware/auth.js";
export function setupEndpointsAuth(router) {
router.post("/v1/apps", async (ctx)=>{
ctx.body = await AuthHelpers.registerApp(ctx);
});
router.get("/v1/apps/verify_credentials", async (ctx)=>{
ctx.body = await AuthHelpers.verifyAppCredentials(ctx);
});
router.post("/v1/iceshrimp/apps/info", MiAuth(true), async (ctx)=>{
ctx.body = await AuthHelpers.getAppInfo(ctx);
});
router.post("/v1/iceshrimp/auth/code", MiAuth(true), async (ctx)=>{
ctx.body = await AuthHelpers.getAuthCode(ctx);
});
}
export function setupEndpointsAuthRoot(router) {
router.post("/oauth/token", async (ctx)=>{
ctx.body = await AuthHelpers.getAuthToken(ctx);
});
router.post("/oauth/revoke", async (ctx)=>{
ctx.body = await AuthHelpers.revokeAuthToken(ctx);
});
}