Top Level Namespace
Defined Under Namespace
Modules: Api, ApplicationCable, ChatService, RailsBase, TwilioService
Classes: AddChat, AddMessage, AddParticipant, Chat, ChatChannel, FacebookService, Message, Participant
Instance Method Summary
collapse
Instance Method Details
#create ⇒ Object
1
2
3
|
# File 'lib/templates/chat/sessions_controller.rb', line 1
def create
super
end
|
#custom_sign_in ⇒ Object
1
2
3
4
5
6
7
|
# File 'lib/templates/facebook/sessions_controller_2.rb', line 1
def custom_sign_in
sign_in(:api_v1_user, @resource)
= @resource.create_new_auth_token
response..merge!()
render_create_success
end
|
#destroy ⇒ Object
5
6
7
|
# File 'lib/templates/chat/sessions_controller.rb', line 5
def destroy
super
end
|
#facebook ⇒ Object
1
2
3
4
5
6
7
8
9
|
# File 'lib/templates/facebook/sessions_controller.rb', line 1
def facebook
user_params = FacebookService.new(params[:access_token]).profile
@resource = User.from_social_provider 'facebook', user_params
custom_sign_in
rescue Koala::Facebook::AuthenticationError
render json: { error: I18n.t('api.facebook.not_authorized') }, status: :forbidden
rescue ActiveRecord::RecordNotUnique
render json: { error: I18n.t('api.facebook.already_registerd') }, status: :bad_request
end
|