Replace legacy checkBodyType with Zod
Start matchmaking integration Start rooms API Move existing room scene locations to roomtypes file Auth checkExpired util for client refreshing
This commit is contained in:
26
src/routes/match/player.ts
Normal file
26
src/routes/match/player.ts
Normal file
@@ -0,0 +1,26 @@
|
||||
import { z } from "zod";
|
||||
import { APIUtils } from "../../apiutils.ts";
|
||||
import express from "express";
|
||||
|
||||
export const route = APIUtils.createRouter('/player');
|
||||
|
||||
interface BaseLoginLock {
|
||||
LoginLock: string
|
||||
}
|
||||
|
||||
const LoginSchema = z.object({
|
||||
LoginLock: z.string().uuid("LoginLock must be a UUIDv4")
|
||||
});
|
||||
|
||||
route.router.post('/login',
|
||||
|
||||
APIUtils.Authentication,
|
||||
express.urlencoded({extended: true}),
|
||||
APIUtils.validateRequestBody(LoginSchema),
|
||||
|
||||
(rq, rs) => {
|
||||
// temporary
|
||||
rs.sendStatus(200);
|
||||
},
|
||||
|
||||
)
|
||||
Reference in New Issue
Block a user