New API route format to make code cleaner

This commit is contained in:
Jesse Wierzbinski 2023-10-15 17:51:29 -10:00
parent c7b2f5b741
commit ca7d325cb1
36 changed files with 600 additions and 237 deletions

View file

@ -1,9 +1,23 @@
import { applyConfig } from "@api";
import { errorResponse } from "@response";
import { MatchedRoute } from "bun";
import { randomBytes } from "crypto";
import { Application } from "~database/entities/Application";
import { Token } from "~database/entities/Token";
import { User } from "~database/entities/User";
import { APIRouteMeta } from "~types/api";
export const meta: APIRouteMeta = applyConfig({
allowedMethods: ["POST"],
ratelimits: {
max: 4,
duration: 60,
},
route: "/auth/login",
auth: {
required: false,
},
});
/**
* OAuth Code flow