Files
fizzy/app/controllers/notifications/unsubscribes_controller.rb
T
Stanko Krtalić 98755844a1 Remove the internal API
* Bind sessions to identities
* Remove references to the identity token
* Move email changes to identity
* Move account menu into a turbo-frame
* Create tenants from a tenanted route
2025-10-31 16:26:08 +01:00

26 lines
576 B
Ruby

class Notifications::UnsubscribesController < ApplicationController
allow_unauthenticated_access
allow_unauthorized_access
skip_before_action :verify_authenticity_token
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