diff --git a/test/api/v3/integration/qrcodes/GET-qrcodes_user.test.js b/test/api/v3/integration/qrcodes/GET-qrcodes_user.test.js deleted file mode 100644 index 796494cecd..0000000000 --- a/test/api/v3/integration/qrcodes/GET-qrcodes_user.test.js +++ /dev/null @@ -1,33 +0,0 @@ -import superagent from 'superagent'; -import nconf from 'nconf'; -import { - generateUser, - translate as t, -} from '../../../../helpers/api-integration/v3'; - -const API_TEST_SERVER_PORT = nconf.get('PORT'); -xdescribe('GET /qr-code/user/:memberId', () => { - let user; - - before(async () => { - user = await generateUser(); - }); - - it('validates req.params.memberId', async () => { - await expect(user.get('/qr-code/user/invalidUUID')).to.eventually.be.rejected.and.eql({ - code: 400, - error: 'BadRequest', - message: t('invalidReqParams'), - }); - }); - - it('redirects to profile page', async () => { - const url = `http://localhost:${API_TEST_SERVER_PORT}/qr-code/user/${user._id}`; - const response = await superagent.get(url).end((err, res) => { - expect(err).to.be(undefined); - return res; - }); - expect(response.status).to.eql(200); - expect(response.request.url).to.eql(`http://localhost:${API_TEST_SERVER_PORT}/static/front/#?memberId=${user._id}`); - }); -}); diff --git a/test/helpers/api-integration/requester.js b/test/helpers/api-integration/requester.js index f5c63b9d14..ad01f35978 100644 --- a/test/helpers/api-integration/requester.js +++ b/test/helpers/api-integration/requester.js @@ -40,7 +40,6 @@ function _requestMaker (user, method, additionalSets = {}) { || route.indexOf('/paypal') === 0 || route.indexOf('/amazon') === 0 || route.indexOf('/stripe') === 0 - || route.indexOf('/qr-code') === 0 || route.indexOf('/analytics') === 0 ) { url += `${route}`; diff --git a/website/common/locales/en/settings.json b/website/common/locales/en/settings.json index f1147f768d..c883eaa79f 100644 --- a/website/common/locales/en/settings.json +++ b/website/common/locales/en/settings.json @@ -28,7 +28,6 @@ "deleteAccount": "Delete Account", "deleteAccPop": "Cancel and remove your Habitica account.", "feedback": "If you'd like to give us feedback, please enter it below - we'd love to know what you liked or didn't like about Habitica! Don't speak English well? No problem! Use the language you prefer.", - "qrCode": "QR Code", "dataExport": "Data Export", "saveData": "Here are a few options for saving your data.", "habitHistory": "Habit History", diff --git a/website/server/controllers/top-level/qrcodes.js b/website/server/controllers/top-level/qrcodes.js deleted file mode 100644 index 588b5c69bd..0000000000 --- a/website/server/controllers/top-level/qrcodes.js +++ /dev/null @@ -1,17 +0,0 @@ -const api = {}; - -api.redirectProfileQRCode = { - method: 'GET', - url: '/qr-code/user/:memberid', - runCron: false, - async handler (req, res) { - req.checkParams('memberid', res.t('memberIdRequired')).notEmpty().isUUID(); - - const validationErrors = req.validationErrors(); - if (validationErrors) throw validationErrors; - - res.redirect(301, `/static/front/#?memberId=${req.params.memberid}`); - }, -}; - -export default api; diff --git a/website/server/middlewares/notFound.js b/website/server/middlewares/notFound.js index feb73d8a7f..77f858e353 100644 --- a/website/server/middlewares/notFound.js +++ b/website/server/middlewares/notFound.js @@ -13,7 +13,6 @@ const TOP_LEVEL_ROUTES = [ '/stripe', '/export', '/email', - '/qr-code', // logout, old-client // and /static/user/auth/local/reset-password-set-new-one don't need the not found // handler because they don't have any child route