class Api::V1::UserTokensController < Api::V1::BaseController
  include AesCryptHelper
  before_action :require_login

  def show
    password = decrypt(params[:password]) rescue params[:password].to_s
    tip_exception("密码不正确") unless current_user.check_password?(password)
    render_ok({access_token: current_user.gitea_token})
  end
end