anitab-org / anitab-org/stem-diverse-tv

Feat: Add forgotten password support

Abierto
#103 4 comentarios 0 reacciones 0 asignados Ver en GitHub
Lenguaje dominante
Python
Estrellas
13
Forks
48
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

### Is your feature request related to a problem? Please describe.
If the user forgets his credentials, we need some recovery mechanism.
### Describe the solution you'd like
Add endpoint for password reset. The user provides the email and he receives the email with the following details:
1.username
2.one-time link that provides the availability for password reset. When the user clicks on that link, the API approves password recovery and let the user provides new password. The link should contain token that will identify that the user request for password reset is valid. If the link is not valid/corrupted/forged, return 401. The link should be valid for 120 mins. After that token expires and his attempt to reset the password from that URL is forbidden.
Steps:
1) user provides an email where to send the reset link
2) API creates one-time link with it's expiration time
3) the link should be sent to the email the user provided
4) user clicks on the link:
- API checks the token in the URL, if the token is expired, returns 401
- if the token is valid, return OK
5) the user now sends the new password, if the token is still valid, set the new password and mark token as used/expired
6) the API returns 200

### Describe alternatives you've considered
N/A
### Additional context
We could use some third-party service for the mail sending or we can use `smtp` library and configure our own SMTP service. Config email credentials (gmail) that will be used as a proxy, and enable usage of the email account for less secure apps (check [here](https://myaccount.google.com/security)). Take care reset URL with token must not be sent in the response (visible to the user via frontend).

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.