mirror of
https://github.com/spacebarchat/server.git
synced 2024-11-25 11:43:07 +01:00
ensure client_id is provided in authorize
This commit is contained in:
parent
6f031dbc93
commit
c353c4fd39
@ -22,6 +22,7 @@ import {
|
|||||||
Application,
|
Application,
|
||||||
ApplicationAuthorizeSchema,
|
ApplicationAuthorizeSchema,
|
||||||
DiscordApiErrors,
|
DiscordApiErrors,
|
||||||
|
FieldErrors,
|
||||||
Member,
|
Member,
|
||||||
Permissions,
|
Permissions,
|
||||||
User,
|
User,
|
||||||
@ -35,6 +36,11 @@ const router = Router();
|
|||||||
router.get(
|
router.get(
|
||||||
"/",
|
"/",
|
||||||
route({
|
route({
|
||||||
|
query: {
|
||||||
|
client_id: {
|
||||||
|
type: "string",
|
||||||
|
},
|
||||||
|
},
|
||||||
responses: {
|
responses: {
|
||||||
// TODO: I really didn't feel like typing all of it out
|
// TODO: I really didn't feel like typing all of it out
|
||||||
200: {},
|
200: {},
|
||||||
@ -49,6 +55,14 @@ router.get(
|
|||||||
async (req: Request, res: Response) => {
|
async (req: Request, res: Response) => {
|
||||||
// const { client_id, scope, response_type, redirect_url } = req.query;
|
// const { client_id, scope, response_type, redirect_url } = req.query;
|
||||||
const { client_id } = req.query;
|
const { client_id } = req.query;
|
||||||
|
if (!client_id) {
|
||||||
|
throw FieldErrors({
|
||||||
|
client_id: {
|
||||||
|
code: "BASE_TYPE_REQUIRED",
|
||||||
|
message: req.t("common:field.BASE_TYPE_REQUIRED"),
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
const app = await Application.findOne({
|
const app = await Application.findOne({
|
||||||
where: {
|
where: {
|
||||||
|
Loading…
Reference in New Issue
Block a user