Merge develop

This commit is contained in:
SabreCat
2022-06-16 13:25:56 -05:00
parent ce67f06bab
commit 4a3a7db52a
142 changed files with 3172 additions and 3138 deletions
@@ -19,6 +19,7 @@ import {
hasBackupAuth,
loginSocial,
registerLocal,
socialEmailToLocal,
} from '../../libs/auth';
import { verifyUsername } from '../../libs/user/validation';
@@ -478,6 +479,7 @@ api.resetPasswordSetNewOne = {
// set new password and make sure it's using bcrypt for hashing
await passwordUtils.convertToBcrypt(user, String(newPassword));
user.auth.local.passwordResetCode = undefined; // Reset saved password reset code
if (!user.auth.local.email) user.auth.local.email = await socialEmailToLocal(user);
await user.save();
return res.respond(200, {}, res.t('passwordChangeSuccess'));
+2 -2
View File
@@ -1318,8 +1318,8 @@ api.userSell = {
* @apiParam (Query) {String} path Full path to unlock. See "content" API call for list of items.
*
* @apiParamExample {curl} Example call:
* curl -X POST http://habitica.com/api/v3/user/unlock?path=background.midnight_clouds
* curl -X POST http://habitica.com/api/v3/user/unlock?path=hair.color.midnight
* curl -X POST https://habitica.com/api/v3/user/unlock?path=background.midnight_clouds
* curl -X POST https://habitica.com/api/v3/user/unlock?path=hair.color.midnight
*
* @apiSuccess {Object} data.purchased
* @apiSuccess {Object} data.items
+5 -5
View File
@@ -43,7 +43,7 @@ const api = {};
* @apiParamExample {json} Task Activity Example
* {
* "enabled": true, // default
* "url": "http://some-webhook-url.com",
* "url": "https://some-webhook-url.com",
* "label": "My Webhook",
* "type": "taskActivity", // default
* "options": {
@@ -56,7 +56,7 @@ const api = {};
* @apiParamExample {json} Group Chat Received Example
* {
* "enabled": true,
* "url": "http://some-webhook-url.com",
* "url": "https://some-webhook-url.com",
* "label": "My Chat Webhook",
* "type": "groupChatReceived",
* "options": {
@@ -66,7 +66,7 @@ const api = {};
* @apiParamExample {json} User Activity Example
* {
* "enabled": true,
* "url": "http://some-webhook-url.com",
* "url": "https://some-webhook-url.com",
* "label": "My Activity Webhook",
* "type": "userActivity",
* "options": { // set at least one to true
@@ -78,7 +78,7 @@ const api = {};
* @apiParamExample {json} Quest Activity Example
* {
* "enabled": true,
* "url": "http://some-webhook-url.com",
* "url": "https://some-webhook-url.com",
* "label": "My Quest Webhook",
* "type": "questActivity",
* "options": { // set at least one to true
@@ -89,7 +89,7 @@ const api = {};
* }
* @apiParamExample {json} Minimal Example
* {
* "url": "http://some-webhook-url.com"
* "url": "https://some-webhook-url.com"
* }
*
* @apiSuccess (201) {Object} data The created webhook
@@ -160,6 +160,7 @@ api.exportUserDataXml = {
/**
* @api {get} /export/avatar-:uuid.html Render a user avatar as an HTML page
* @apiName ExportUserAvatarHtml
* @apiDescription This HTML export feature is not currently working (https://github.com/HabitRPG/habitica/issues/9489).
* @apiGroup DataExport
*
* @apiParam (Path) {String} uuid The User ID of the user
@@ -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;