我正在使用devise进行身份验证,现在我想为给定的电子邮件设置确认帐户(devise中的:confirmable
模块)。我的应用程序是一个API应用程序,它使用REST端点与前端应用程序(实际上是移动应用程序)连接。我想知道标准设计流程中的哪个端点负责发送电子邮件,以及哪个实际确认帐户(钩住电子邮件中的confirm
按钮)。
我的路线:
root@83afeb8ffb71:/usr/src/app# rails routes | grep account
new_account_confirmation GET /api/v1/account/confirmation/new(.:format) api/v1/account/confirmations#new {:format=>:json}
account_confirmation GET /api/v1/account/confirmation(.:format) api/v1/account/confirmations#show {:format=>:json}
POST /api/v1/account/confirmation(.:format) api/v1/account/confirmations#create {:format=>:json}
我在docs中看到电子邮件是由POST /api/v1/account/confirmation
触发的,所以当用户从电子邮件中单击confirm
按钮时,哪个端点正在进行某些更改?我在文档中看不到任何PUT端点。
POST /api/v1/account/confirmation
PUT POST DELETE PATCH
仅重定向到GET
,因此在您的应用程序发送此URL GET /api/v1/account/confirmation
的电子邮件中,您可以在此端点上使用深度链接并将用户重定向到应用程序。