username sanitisation for registration

This commit is contained in:
Cadence Ember
2023-05-08 17:22:20 +12:00
parent 48c2ef76f5
commit 7ee04d085f
8 changed files with 402 additions and 2350 deletions

20
matrix/api.js Normal file
View File

@@ -0,0 +1,20 @@
// @ts-check
const passthrough = require("../passthrough")
const { discord, sync, db } = passthrough
/** @type {import("./mreq")} */
const mreq = sync.require("./mreq")
/** @type {import("./file")} */
const file = sync.require("./file")
/**
* @returns {Promise<import("../types").R.Registered>}
*/
function register(username) {
return mreq.mreq("POST", "/client/v3/register", {
type: "m.login.application_service",
username
})
}
module.exports.register = register