Skip to content

Commit 3538764

Browse files
Disabled registration via api in production
1 parent 5fe2fd5 commit 3538764

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

web/routes/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Route.get('/', async (_req, res) => {
1515
* GET and set the csrf cookie
1616
*/
1717
Route.get('/csrf-cookie', (req, res) => {
18-
res.cookie('XSRF-TOKEN', req.csrfToken(), {domain: process.env.COOKIE_DOMAIN || 'localhost'})
18+
res.cookie('XSRF-TOKEN', req.csrfToken(), { domain: process.env.COOKIE_DOMAIN || 'localhost' })
1919
res.status(204).json('')
2020
})
2121

@@ -35,6 +35,7 @@ Route.post('/login', guest, async (req, res) => {
3535

3636
/** Register a new user */
3737
Route.post('/register', guest, async (req, res) => {
38+
if (process.env.NODE_ENV === 'production') { return res.status(405).json('Method not allowed') }
3839
try {
3940
const { status, message } = await AuthController.register(req.body)
4041
if (status === 200) {

0 commit comments

Comments
 (0)