codeuino / social-platform-donut-backend

Donut API:
http://donut-api-prod.codeuino.org/
GNU General Public License v3.0
24 stars 57 forks source link

Implement backend for invite user through invite link #123

Open Rupeshiya opened 4 years ago

Rupeshiya commented 4 years ago

Is your feature request related to a problem? Please describe. The feature is not related to any problem but it's an extra feature that needs to be implemented. So the feature is if any user of the platform want to invite any other user which on the platform so they can invite through a link, which will be used by other to get registered as a user of the platform.

Describe the solution you'd like One solution I can think of just generates the token using the senders token (use jsonwebtoken signed with the expiry time and sender's token). Now when the user who is invited will receive the link, let say: http://localhost:5000/invite/${token} and the link is clicked then a GET the request will be sent to the server so will catch that request and then in that request in the backend decode that token and check user collections if that user exists i.e sender and the token is not expired then it's valid invitation so now directly redirect the invitation receiver to the register page else send the message that invitation is not valid.

Additional context Working on it