Module: AuthlogicRpx::Helper
- Defined in:
- lib/authlogic_rpx/helper.rb
Instance Method Summary collapse
-
#rpx_embed(options = {}) ⇒ Object
helper to insert an embedded iframe RPX login takes options hash: *
app_name:
name of the application (will be prepended to RPX domain and used in RPX dialogues) *return_url:
url for the RPX callback (e.g. user_sessions_url) *add_rpx:
if true, requests RPX callback to add to current session. -
#rpx_popup(options = {}) ⇒ Object
helper to insert a link to pop-up RPX login takes options hash: *
link_text:
text to use in the link *app_name:
name of the application (will be prepended to RPX domain and used in RPX dialogues) *return_url:
url for the RPX callback (e.g. user_sessions_url) *add_rpx:
if true, requests RPX callback to add to current session.
Instance Method Details
#rpx_embed(options = {}) ⇒ Object
helper to insert an embedded iframe RPX login takes options hash:
* <tt>app_name:</tt> name of the application (will be prepended to RPX domain and used in RPX dialogues)
* <tt>return_url:</tt> url for the RPX callback (e.g. user_sessions_url)
* <tt>add_rpx:</tt> if true, requests RPX callback to add to current session. Else runs normal authentication process (default)
The options hash may include other options as supported by rpx_now (see github.com/grosser/rpx_now)
12 13 14 15 16 17 18 19 20 21 |
# File 'lib/authlogic_rpx/helper.rb', line 12 def ( = {}) app_name = .delete( :app_name ) token_url = build_token_url!( ) html = RPXNow.(app_name, token_url, ) if defined? raw raw html else html end end |
#rpx_popup(options = {}) ⇒ Object
helper to insert a link to pop-up RPX login takes options hash:
* <tt>link_text:</tt> text to use in the link
* <tt>app_name:</tt> name of the application (will be prepended to RPX domain and used in RPX dialogues)
* <tt>return_url:</tt> url for the RPX callback (e.g. user_sessions_url)
* <tt>add_rpx:</tt> if true, requests RPX callback to add to current session. Else runs normal authentication process (default)
* <tt>unobtrusive:</tt> true/false; sets javascript style for link. Default: true
The options hash may include other options as supported by rpx_now (see github.com/grosser/rpx_now)
33 34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/authlogic_rpx/helper.rb', line 33 def rpx_popup( = {}) = { :unobtrusive => true, :add_rpx => false }.merge( ) app_name = .delete( :app_name ) link_text = .delete( :link_text ) token_url = build_token_url!( ) html = RPXNow.popup_code( link_text, app_name, token_url, ) if defined? raw raw html else html end end |