You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
asciinema.org/app/controllers/api_tokens_controller.rb

13 lines
262 B
Ruby

class ApiTokensController < ApplicationController
before_filter :ensure_authenticated!
def destroy
api_token = ApiToken.find(params[:id])
authorize api_token
api_token.revoke!
redirect_to edit_user_path, notice: "Token revoked."
end
end