lib/balrog/view_helpers.rb in balrog-1.1.0 vs lib/balrog/view_helpers.rb in balrog-2.0.0
- old
+ new
@@ -1,6 +1,6 @@
-# ViewHelpers methods are made available in all controllers by the code in engine.rb.
+# ViewHelpers methods are made available in all views by the code in engine.rb.
module Balrog::ViewHelpers
def balrog_logout_button(options = nil, html_options = nil)
name = 'Logout'
html_options ||= {}
html_options[:method] = 'delete'
@@ -10,7 +10,15 @@
elsif options.is_a?(Hash)
html_options = html_options.merge(options)
end
button_to(name, '/balrog/logout', html_options)
+ end
+
+ def show_balrog_password_prompt?
+ !!Balrog::Middleware.password_hash || !Balrog::Middleware.omniauth_config
+ end
+
+ def balrog_omniauth_configured?
+ !!Balrog::Middleware.omniauth_config
end
end