Introduces legacy endpoints for login, joinserver, and checkserver, along with their input validation schemas. Updates sessionsService with joinLegacyServer to support legacy session handling. This enables compatibility with legacy clients requiring these authentication flows.
16 lines
366 B
JavaScript
16 lines
366 B
JavaScript
const z = require("zod")
|
|
|
|
const loginShape = {
|
|
user: z.string().min(1, { message: "Username required" }),
|
|
password: z.string().min(1, { message: "Password required" }),
|
|
version: z.union([z.string(), z.number()]).optional()
|
|
}
|
|
|
|
module.exports = {
|
|
POST: {
|
|
body: z.object(loginShape),
|
|
},
|
|
GET: {
|
|
query: z.object(loginShape)
|
|
}
|
|
} |