Module: Platform::ActionControllerExtension::InstanceMethods

Defined in:
lib/platform/extensions/action_controller_extension.rb

Instance Method Summary collapse

Instance Method Details

#platform_login_urlObject



51
52
53
# File 'lib/platform/extensions/action_controller_extension.rb', line 51

def 
  platform_stringify_url(Platform::Config., :display => params[:display], :client_id => params[:client_id])
end

#platform_logout_urlObject



55
56
57
# File 'lib/platform/extensions/action_controller_extension.rb', line 55

def platform_logout_url
  platform_stringify_url(Platform::Config.logout_url, :display => params[:display], :client_id => params[:client_id])
end

#platform_oauth_redirect_paramsObject



47
48
49
# File 'lib/platform/extensions/action_controller_extension.rb', line 47

def platform_oauth_redirect_params
  session[:platform_oauth_redirect_params]
end

#platform_redirect_to_oauthObject



31
32
33
34
35
36
37
# File 'lib/platform/extensions/action_controller_extension.rb', line 31

def platform_redirect_to_oauth
  if platform_oauth_redirect_params
    redirect_to(platform_oauth_redirect_params)
    return true
  end
  false
end

#platform_remove_oauth_redirect_paramsObject



43
44
45
# File 'lib/platform/extensions/action_controller_extension.rb', line 43

def platform_remove_oauth_redirect_params
  session[:platform_oauth_redirect_params] = nil
end

#platform_store_oauth_redirect_paramsObject



39
40
41
# File 'lib/platform/extensions/action_controller_extension.rb', line 39

def platform_store_oauth_redirect_params
  session[:platform_oauth_redirect_params] = params
end

#platform_stringify_url(path, params) ⇒ Object



59
60
61
# File 'lib/platform/extensions/action_controller_extension.rb', line 59

def platform_stringify_url(path, params)
  "#{path}#{path.index('?') ? '&' : '?'}#{params.collect{|n,v| "#{n}=#{CGI.escape(v.to_s)}"}.join("&")}"
end