RESTful reset password and confirm email

2019-03-18 19:59发布

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

confirm email

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

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

reset password (similar problem)

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

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

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

标签: rest uri
7条回答
仙女界的扛把子
2楼-- · 2019-03-18 20:33

I've recently worked on this, my take was

POST /{base_url}/password

because I was actually creating a new random password and sending it over to the user

and

PUT /{base_url}/confirmation?token=...

Because I am updating the confirmation that was already sent out when the user registered.

查看更多
登录 后发表回答