Class: Stormpath::Rails::SocialController

Inherits:
BaseController
  • Object
show all
Defined in:
app/controllers/stormpath/rails/social_controller.rb

Instance Method Summary collapse

Instance Method Details

#login_the_account(account) ⇒ Object



4
5
6
7
8
9
10
# File 'app/controllers/stormpath/rails/social_controller.rb', line 4

def ()
  AccountLoginWithStormpathToken.new(
    cookies, ,
    Stormpath::Rails::Client.application,
    Stormpath::Rails::Client.client.data_store.api_key
  ).call
end

#respond_with_error(error) ⇒ Object



19
20
21
22
23
24
25
26
27
28
29
# File 'app/controllers/stormpath/rails/social_controller.rb', line 19

def respond_with_error(error)
  respond_to do |format|
    format.html do
      flash.now[:error] = error.message
      render stormpath_config.web..view
    end
    format.json do
      render json: { status: error.status, message: error.message }, status: error.status
    end
  end
end

#respond_with_successObject



12
13
14
15
16
17
# File 'app/controllers/stormpath/rails/social_controller.rb', line 12

def respond_with_success
  respond_to do |format|
    format.json { render nothing: true, status: :ok }
    format.html { redirect_to stormpath_config.web..next_uri }
  end
end