Any examples of Sinatra+Warden with 'confirmation' and 'forgot password' mail support?

StackOverflow https://stackoverflow.com/questions/17643427

  •  03-06-2022
  •  | 
  •  

Are there examples of how to use Sinatra and Warden with 'confirmation' and 'forgot password' mail support?

有帮助吗?

解决方案

On my reading of the Warden documentation, 'confirmation' and 'forgot password' are largely outside the scope of Warden. Here is how to approach implementing confirmation as an example.

  1. Add confirm and confirmed? methods to your User class.
  2. Add a :unconfirmed scope to warden. This will be used to allow access to your confirmation page when logged in, but not confirmed.
  3. In your Warden authenticate! method, check both the Users authentication as well as the confirmed? method.
  4. Add a system for sending confirmation emails on new messages.
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top