mirror of
https://github.com/discourse/discourse.git
synced 2025-05-21 18:12:32 +08:00
Migrate unsubscribe keys to the database.
This should reduce a lot of the keys in redis.
This commit is contained in:
@ -10,7 +10,7 @@ class EmailController < ApplicationController
|
||||
end
|
||||
|
||||
def unsubscribe
|
||||
@user = User.find_by_temporary_key(params[:key])
|
||||
@user = DigestUnsubscribeKey.user_for_key(params[:key])
|
||||
|
||||
# Don't allow the use of a key while logged in as a different user
|
||||
if current_user.present? && (@user != current_user)
|
||||
@ -28,7 +28,7 @@ class EmailController < ApplicationController
|
||||
end
|
||||
|
||||
def resubscribe
|
||||
@user = User.find_by_temporary_key(params[:key])
|
||||
@user = DigestUnsubscribeKey.user_for_key(params[:key])
|
||||
raise Discourse::NotFound unless @user.present?
|
||||
@user.update_column(:email_digests, true)
|
||||
end
|
||||
|
Reference in New Issue
Block a user