azures04 c5b6f6c107 Add Discord OAuth2 account linking and login support
Introduces Discord OAuth2 integration for account association and login, including new routes for linking, unlinking, and authenticating via Discord. Adds supporting services, repositories, and schema validation for the OAuth2 flow. Refactors database schema and queries for consistency, and updates dependencies to include required OAuth2 libraries.
2026-01-11 21:03:12 +01:00

24 lines
759 B
JavaScript

const z = require("zod")
module.exports = {
GET: {
query: z.object({
code: z.string({ required_error: "Authorisation code required" }),
state: z.string({ required_error: "The state parameter is required." })
}),
error: {
code: 400,
message: "Invalid Discord callback settings"
}
},
DELETE: {
headers: z.object({
authorization: z.string({ required_error: "The authentication token is required." })
.regex(/^Bearer\s.+/, { message: "Invalid Authorization header format (Bearer token expected)" })
}),
error: {
code: 401,
message: "Authentication required for disassociation"
}
}
}