mirror of
https://github.com/psforever/PSFPortal.git
synced 2026-01-19 18:14:45 +00:00
Disable registration
This commit is contained in:
parent
d36fbbde9a
commit
3c5482a4c7
|
|
@ -7,7 +7,10 @@ api.post('/register', async (req, res, next) => {
|
|||
const rUsername = req.body.username;
|
||||
const rPassword = req.body.password;
|
||||
const rEmail = req.body.email; // TODO: validate email regex
|
||||
|
||||
// TODO: recaptcha, csrf protection
|
||||
res.status(403).json({message: "Registration is disabled"});
|
||||
return;
|
||||
|
||||
if (!rUsername || !rPassword || !rEmail) {
|
||||
res.status(400).json({message: "missing fields"});
|
||||
|
|
|
|||
|
|
@ -50,6 +50,8 @@
|
|||
alert.message("Unknown server error. Contact an administrator if this persists.")
|
||||
} else if (e.response.status === 400) {
|
||||
alert.message(e.response.data.message)
|
||||
} else if (e.response.status === 403) {
|
||||
alert.message(e.response.data.message)
|
||||
} else {
|
||||
alert.message("Unknown server error status");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,7 +7,8 @@
|
|||
"scripts": {
|
||||
"build": "cross-env NODE_ENV=production webpack --config webpack.config.cjs",
|
||||
"dev": "webpack-dev-server --history-api-fallback --config webpack.config.cjs --content-base public",
|
||||
"dev-server": "nodemon -w api/ -w index.js"
|
||||
"dev-server": "nodemon -w api/ -w index.js",
|
||||
"production": "npm run build && node index.js"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
|
|
|
|||
Loading…
Reference in a new issue