authorizations_controller.rb 372 Bytes
Newer Older
Eugen Rochko's avatar
Eugen Rochko committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
# frozen_string_literal: true

class AuthorizationsController < ApplicationController
  before_action :authenticate_user!
  before_action :set_authorization

  def destroy
    @authorization.destroy
    redirect_to account_path, notice: 'Disconnected!'
  end

  private

  def set_authorization
    @authorization = current_user.authorizations.find(params[:id])
  end
end