mirror of
https://github.com/neocities/neocities.git
synced 2025-04-24 17:22:35 +02:00
fixes to password reset
This commit is contained in:
parent
82195a9cb8
commit
6245319bc1
2 changed files with 4 additions and 2 deletions
4
app.rb
4
app.rb
|
@ -375,9 +375,8 @@ post '/send_password_reset' do
|
|||
site = Site[email: params[:email]]
|
||||
|
||||
if site
|
||||
site.update password_reset_token: token
|
||||
|
||||
token = SecureRandom.uuid.gsub('-', '')
|
||||
site.update password_reset_token: token
|
||||
|
||||
body = <<-EOT
|
||||
Hello! This is the NeoCities cat, and I have received a password reset request for your e-mail address. Purrrr.
|
||||
|
@ -393,6 +392,7 @@ the NeoCities Cat
|
|||
body.strip!
|
||||
|
||||
EmailWorker.perform_async({
|
||||
from: 'web@neocities.org',
|
||||
to: params[:email],
|
||||
subject: '[NeoCities] Password Reset',
|
||||
body: body
|
||||
|
|
|
@ -1,8 +1,10 @@
|
|||
class EmailWorker
|
||||
include Sidekiq::Worker
|
||||
sidekiq_options queue: :emails, retry: 10, backtrace: true
|
||||
|
||||
def perform(args={})
|
||||
Mail.deliver do
|
||||
from args[:from]
|
||||
to args[:to]
|
||||
subject args[:subject]
|
||||
body args[:body]
|
||||
|
|
Loading…
Add table
Reference in a new issue