diff --git a/api/src/controllers/userController.js b/api/src/controllers/userController.js index 8306594e6..d8c3d00e6 100644 --- a/api/src/controllers/userController.js +++ b/api/src/controllers/userController.js @@ -155,15 +155,18 @@ const registerUser = async (req, res) => { }) } + const responseData = {} + if (isCognito) { await registerCognito(username, password) + responseData.message = 'Code for sign up confirmation was sent to your email' + responseData.forSignUpConfirmation = true } else { await registerLocal(username, password) + responseData.message = 'The user has been registered' } - res.status(201).send({ - message: 'The user has been registered' - }) + res.status(201).send(responseData) } catch (err) { res.status(409).json({ error: err.message }) } diff --git a/package.json b/package.json index e7cd96ad6..de507d0a0 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,7 @@ "@testing-library/jest-dom": "^5.11.4", "@testing-library/react": "^11.1.0", "@testing-library/user-event": "^12.1.10", - "aws-amplify": "^3.3.27", + "aws-amplify": "^4.3.21", "axios": "^0.21.1", "classnames": "^2.3.1", "dayjs": "^1.10.7", diff --git a/public/index.html b/public/index.html index 5583c169a..8cd2bf10b 100644 --- a/public/index.html +++ b/public/index.html @@ -24,6 +24,7 @@
+