mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-16 22:27:26 +01:00
Groups can prevent members from getting gems (#8870)
* add possibility for group to block members from getting gems * fixes * fix tests * adds some tests * unit tests * finish unit tests * remove old code
This commit is contained in:
committed by
Sabe Jones
parent
fe9521a63f
commit
78ba596504
@@ -21,6 +21,9 @@ api.constants = {
|
||||
};
|
||||
|
||||
api.verifyGemPurchase = async function verifyGemPurchase (user, receipt, headers) {
|
||||
const userCanGetGems = await user.canGetGems();
|
||||
if (!userCanGetGems) throw new NotAuthorized(shared.i18n.t('groupPolicyCannotGetGems', user.preferences.language));
|
||||
|
||||
await iap.setup();
|
||||
let appleRes = await iap.validate(iap.APPLE, receipt);
|
||||
let isValidated = iap.isValidated(appleRes);
|
||||
|
||||
Reference in New Issue
Block a user