mirror of
https://github.com/wahyd4/gitlabhq.git
synced 2026-08-11 13:46:11 +10:00
12 lines
259 B
Ruby
12 lines
259 B
Ruby
module Gitlab
|
|
module APIHelpers
|
|
def current_user
|
|
@current_user ||= User.find_by_authentication_token(params[:private_token])
|
|
end
|
|
|
|
def authenticate!
|
|
error!({'message' => '401 Unauthorized'}, 401) unless current_user
|
|
end
|
|
end
|
|
end
|