synapsestudios/synapse-base — pull request #27 by paulstatezny (2014-04-11 23:57:02+00:00)
Title: Correct Reset Password Endpoint

## Correct Reset Password Endpoint

### Acceptance Criteria
1. Endpoint exists at `/user/reset-password` instead of `/user/{id}/reset-password`.
1. `POST` creates reset password token based on provided email address rather than trying to find the currently logged in user based on OAuth authentication.
1. `PUT` checks validity of token based on given user email address instead of OAuth.
1. Tokens expire after 1 hour.

Tests:
1. [x] `POST` calls `UserService::findByEmail()` with `['email' => $this->content['email']]`.
1. [x] `POST` calls `UserService::createUserToken()` if account exists.
1. [x] `POST` calls `EmailService::createFromArray()` if account exists.
1. [ ] `POST` calls `EmailService::enqueueSendEmailJob()` if account exists.
1. [ ] `POST` returns 204 without any content in the body, if account exists.
1. [ ] `POST` returns 404 if account does not exist.
1. [ ] `PUT` returns 404 if token not found.
1. [ ] `PUT` returns 404 if token expired.
1. [ ] `PUT` returns 422 if request does not contain new password.
1. [ ] `PUT` returns 200 and user entity (without password) in response body on success.
1. [ ] `PUT` calls `UserService::resetPassword()` on success.
1. [ ] `PUT` calls `UserService::deleteToken()` on success.