在解析中更改密码 [英] Change password in parse

查看:47
本文介绍了在解析中更改密码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在实施忘记密码时遇到问题.我想更改 PFUser 的密码.我只有电子邮件地址.

I have an issue in implementing forgot password. I want to change password of PFUser. I have email address only.

   PFQuery *query = [PFUser query];
    [query whereKey:@"email" equalTo:[txtUserID.text lowercaseString]];
    NSArray *arr=[query findObjects];

现在我尝试更改密码.

PFUser *user = [arr objectAtIndex:0];
user.password=txtConfirmPassword.text;
[user save];

它说我需要身份验证才能更改密码.为此,我没有首先登录的密码.另一种方法是使用 requestPasswordResetForEmailInBackground.但它会发送电子邮件,用户需要单击该链接并设置密码.我的客户不想要那一步.我们还有另一项服务,通过询问一些问题(例如生日、母亲姓名等)来照顾用户.

It says I need authentication to change password. For that I dont have password to login in first place. Other way is using requestPasswordResetForEmailInBackground. But It sends email and user need to click that link and set password. My client do not want that step. We have our another service which takes care of users by asking few questions like birthdate, mothers name etc.

我认为应该有一种方法可以以管理员身份登录,具有读/写权限.

I think there should be a way to login as administrator, who has read/write authority.

有人用过这样的东西吗?请帮忙.谢谢.

Anyone has used anything like that? Please help. Thanks.

推荐答案

解析文档.

您不会从设备重置密码.这一切都是通过解析重置密码"工作流程在服务器端完成的.

You don't reset the passwords from the device. It is all done server side through the Parse "reset passwords" work flow.

即请求忘记密码的电子邮件,访问网站,创建新的等等......

i.e. request email for forgotten password, go to website, create new, etc.....

设备唯一完成的部分是请求重置密码电子邮件.

The only part done from the device is requesting the reset password email.

编辑

要编辑登录用户的密码,您将能够使用您拥有的代码,因为您将拥有对当前用户对象的写访问权限.

For editing a password of a logged in user you will be able to use the code you have as you will have write access to the current user object.

这篇关于在解析中更改密码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆