6895135977
Replace deprecated `skip_before_action :verify_authenticity_token` with `skip_forgery_protection` to resolve Rails deprecation warnings. Changes: - app/controllers/notifications/unsubscribes_controller.rb - saas/app/controllers/stripe/webhooks_controller.rb
25 lines
526 B
Ruby
25 lines
526 B
Ruby
class Notifications::UnsubscribesController < ApplicationController
|
|
allow_unauthenticated_access
|
|
skip_forgery_protection
|
|
|
|
before_action :set_user
|
|
|
|
def new
|
|
end
|
|
|
|
def create
|
|
@user.settings.bundle_email_never!
|
|
redirect_to notifications_unsubscribe_path(access_token: params[:access_token])
|
|
end
|
|
|
|
def show
|
|
end
|
|
|
|
private
|
|
def set_user
|
|
unless @user = User.find_by_token_for(:unsubscribe, params[:access_token])
|
|
redirect_to root_path, alert: "Invalid unsubscribe link"
|
|
end
|
|
end
|
|
end
|