admin管理员组文章数量:1316408
My application supports normal registration for admin roles and registration by invite for team members. Admins can successfully register themselves. Login functionality is also working fine. I am using jwt for token generation and AuthGuards
to protect private routes.
Need some help on how I can send an invitation url to users? (nodemailer already configured and working). More concerned about url generation.
Can someone help me? The application backend is in nestjs and frontend is in angular 8. Currently I am testing apis through postman.
Thanks in advance, Ajinkya
My application supports normal registration for admin roles and registration by invite for team members. Admins can successfully register themselves. Login functionality is also working fine. I am using jwt for token generation and AuthGuards
to protect private routes.
Need some help on how I can send an invitation url to users? (nodemailer already configured and working). More concerned about url generation.
Can someone help me? The application backend is in nestjs and frontend is in angular 8. Currently I am testing apis through postman.
Thanks in advance, Ajinkya
Share Improve this question edited Jul 22, 2019 at 10:43 Kim Kern 60.6k20 gold badges217 silver badges214 bronze badges asked Jul 22, 2019 at 9:38 Ajinkya GanooAjinkya Ganoo 1652 silver badges12 bronze badges1 Answer
Reset to default 101) Create a database entity invitation-token
with one column token
(randomly generated UUID, e.g. with this uuid lib). Set it to self-delete entries after 24 hours. (e.g. TTL in mongodb)
2) Create an endpoint that allows registration with a query param invitation-token
,
e.g. /registration?invitation-token=Usa67Nsus78
. It only allows registration if the given token exists in the table created in step 1).
3) Create an invite
endpoint that takes a mail address as input. It creates a new token in the invitation-token
table and sends an email to the given address with a link to the endpoint in 2)
本文标签: javascriptHow can we implement a registration by invitation in existing applicationStack Overflow
版权声明:本文标题:javascript - How can we implement a registration by invitation in existing application? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742002410a2411280.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论