Add legacy authentication and session routes
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.
This commit is contained in:
11
schemas/legacy/joinserver.js
Normal file
11
schemas/legacy/joinserver.js
Normal file
@@ -0,0 +1,11 @@
|
||||
const z = require("zod")
|
||||
|
||||
module.exports = {
|
||||
GET: {
|
||||
query: z.object({
|
||||
user: z.string().min(1),
|
||||
sessionId: z.string().min(1),
|
||||
serverId: z.string().min(1)
|
||||
})
|
||||
}
|
||||
}
|
||||
10
schemas/legacy/legacy/checkserver.js
Normal file
10
schemas/legacy/legacy/checkserver.js
Normal file
@@ -0,0 +1,10 @@
|
||||
const z = require("zod")
|
||||
|
||||
module.exports = {
|
||||
GET: {
|
||||
query: z.object({
|
||||
user: z.string().min(1),
|
||||
serverId: z.string().min(1)
|
||||
})
|
||||
}
|
||||
}
|
||||
16
schemas/legacy/login.js
Normal file
16
schemas/legacy/login.js
Normal file
@@ -0,0 +1,16 @@
|
||||
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)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user