Module: Auth::ResourceHelper

Defined in:
app/helpers/auth/resource_helper.rb

Instance Method Summary collapse

Instance Method Details

#login_label_text(resource) ⇒ Object



2
3
4
5
6
7
8
9
# File 'app/helpers/auth/resource_helper.rb', line 2

def  resource
   ##the login params may be just [:email], or [:email, :additional_login_param]
   ##if just [:email] -> it should become ["Email"]
   ##if [:email, :additional_login_param] -> it should become ["Email"."Whatever is the additional login param name specified in the auth_resources"]
   ##after that we combine the string -> using "Or"
    = Auth.configuration.auth_resources[resource.resource_key_for_auth_configuration][:login_params].map{|c| c = (c == :additional_login_param) ? Auth.configuration.auth_resources[resource.resource_key_for_auth_configuration][:additional_login_param_name].to_s.underscore.capitalize : (c.to_s.underscore.capitalize)}
   .join(" or ")
end