RESTful 重置密码和确认电子邮件 [英] RESTful reset password and confirm email

查看:78
本文介绍了RESTful 重置密码和确认电子邮件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在想如何确认电子邮件和请求重置密码的最佳 RESTful 方式是什么.我只是想找到正确的 URI...

im thinking what is the best RESTful way how confirm email and request reseting password. Im only aiming to find correct URI...

确认电子邮件

PUT/users/{userId}/confirmEmail?code=xyz - 由于 confirmEmail 的存在,似乎没有多少 RESTful

PUT /users/{userId}/confirmEmail?code=xyz - does not seem much RESTful because of confirmEmail

PUT/users/{userId}/email?confirmedBy=xyz - 也许更好?不知道

PUT /users/{userId}/email?confirmedBy=xyz - maybe better? dunno

重置密码(类似问题)

PUT/users/{userId}/resetPassword --DATA {email:xyz@xyz.xy} - 和以前一样的想法

PUT /users/{userId}/resetPassword --DATA {email:xyz@xyz.xy} - same thinkin as before

PUT/users/{userId}/password --DATA {state:reseted,resent:xyz@xyz.xy} - 嗯...我又不确定

PUT /users/{userId}/password --DATA {state:reseted,resent:xyz@xyz.xy} - hmmm... again Im not sure

你有什么更好的方法吗?:-)

are there any better ways in your mind?:-)

推荐答案

如果您希望您的 URI 引用资源,请调用资源 confirmation 并向用户帐户 POST 确认.

If you want your URIs to refer to resources, then call the resource confirmation and POST confirmations to user accounts.

POST /users/{userid}/confirmation

这篇关于RESTful 重置密码和确认电子邮件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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