Add more API route definitions

This commit is contained in:
Jesse Wierzbinski 2023-10-16 07:39:41 -10:00
parent a8d8b70239
commit 7f2e89ab20
10 changed files with 140 additions and 10 deletions

View file

@ -1,5 +1,18 @@
import { applyConfig } from "@api";
import { MatchedRoute } from "bun";
export const meta = applyConfig({
allowedMethods: ["GET"],
auth: {
required: false,
},
ratelimits: {
duration: 60,
max: 20,
},
route: "/oauth/authorize",
});
/**
* Returns an HTML login form
*/

View file

@ -1,7 +1,20 @@
import { applyConfig } from "@api";
import { parseRequest } from "@request";
import { errorResponse, jsonResponse } from "@response";
import { Token } from "~database/entities/Token";
export const meta = applyConfig({
allowedMethods: ["POST"],
auth: {
required: false,
},
ratelimits: {
duration: 60,
max: 10,
},
route: "/oauth/token",
});
/**
* Allows getting token from OAuth code
*/