15 lines
349 B
Ruby
15 lines
349 B
Ruby
class ApisController < ApplicationController
|
|
authenticate_with_oauth
|
|
before_filter :set_user_from_oauth
|
|
respond_to :json
|
|
|
|
def me
|
|
@person = @user.person
|
|
render :json => {:birthday => @person.profile.birthday, :name => @person.name}
|
|
end
|
|
|
|
private
|
|
def set_user_from_oauth
|
|
@user = request.env['oauth2'].resource_owner
|
|
end
|
|
end
|