core: allow changing marketing emails consent settings

This commit is contained in:
Abdullah Atta
2023-05-31 19:47:08 +05:00
committed by Abdullah Atta
parent 49e7bdf202
commit ab29a01649
2 changed files with 15 additions and 0 deletions

View File

@@ -309,6 +309,20 @@ class UserManager {
});
}
async changeMarketingConsent(enabled) {
let token = await this.tokenManager.getAccessToken();
if (!token) return;
await http.patch(
`${constants.AUTH_HOST}${ENDPOINTS.patchUser}`,
{
type: "change_marketing_consent",
enabled: enabled
},
token
);
}
resetPassword(newPassword) {
return this._updatePassword("reset_password", {
new_password: newPassword

View File

@@ -36,6 +36,7 @@ const _ignore = "";
* id: string,
* email: string,
* isEmailConfirmed: boolean,
* marketingConsent: boolean,
* mfa: {
* isEnabled: boolean,
* primaryMethod: string,