mirror of
https://github.com/System-End/hackatime.git
synced 2026-04-19 23:32:53 +00:00
17 lines
342 B
Ruby
17 lines
342 B
Ruby
module Api
|
|
module V1
|
|
module Authenticated
|
|
class ApiKeysController < ApplicationController
|
|
def index
|
|
render json: { token: api_key.token }
|
|
end
|
|
|
|
private
|
|
|
|
def api_key
|
|
@api_key ||= current_user.api_keys.first || current_user.api_keys.create!
|
|
end
|
|
end
|
|
end
|
|
end
|
|
end
|