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

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

  •  03-06-2022
  •  | 
  •  

Question

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

Was it helpful?

Solution

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.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top