enviroCar/enviroCar-server — pull request #145 by matthesrieke (2013-11-19 13:52:13+00:00)
Title: Feature reset password

This introduces the password reset mechanism. It can be accessed as follows:

To create a verification code, simply do a POST against `https://envirocar.org/api/dev/resetPassword` with payload:
```JSON
{
"user":{
"name":"myname",
"mail":"mymail@mail.com"
}
}
```
If status code is 204 the code was succesfully generated and an email should have been sent out to the email of the user. If something fails, a corresponding JSON error message is returned. This can be the case if the provided user/mail combination does not exist - or if there is already a verficiation code generated. codes expire automatically after 24 hours.

To reset the password (using the code), simply do a PUT against `https://envirocar.org/api/dev/resetPassword` with similar payload:

```JSON
{
"user":{
"name":"myname",
"token":"mynewpassword",
},
"code":"7c8cfaf5-559e-43fa-8bbd-da4337065158"
}
```

Response types as above. 204 indicates successful update of the password.

Mail sending is configured through config and template files (`WEB-INF/classes/org/envirocar/server/event`). Currently, Only SMTP over SSL is supported. Gmail works, so we could use the same account as for the reCAPTCHA.