Initial commit - fresh start
This commit is contained in:
0
lib/assets/.keep
Normal file
0
lib/assets/.keep
Normal file
50
lib/spree/authentication_helpers.rb
Normal file
50
lib/spree/authentication_helpers.rb
Normal file
@@ -0,0 +1,50 @@
|
||||
module Spree
|
||||
module AuthenticationHelpers
|
||||
def self.included(receiver)
|
||||
receiver.helper_method(
|
||||
:spree_current_user,
|
||||
:spree_login_path,
|
||||
:spree_signup_path,
|
||||
:spree_logout_path,
|
||||
:spree_forgot_password_path,
|
||||
:spree_edit_password_path,
|
||||
:spree_admin_login_path,
|
||||
:spree_admin_logout_path
|
||||
)
|
||||
end
|
||||
|
||||
def spree_current_user
|
||||
send("current_#{Spree.user_class.model_name.singular_route_key}")
|
||||
end
|
||||
|
||||
def spree_login_path(opts = {})
|
||||
new_session_path(Spree.user_class.model_name.singular_route_key, opts)
|
||||
end
|
||||
|
||||
def spree_signup_path(opts = {})
|
||||
new_registration_path(Spree.user_class.model_name.singular_route_key, opts)
|
||||
end
|
||||
|
||||
def spree_logout_path(opts = {})
|
||||
destroy_session_path(Spree.user_class.model_name.singular_route_key, opts)
|
||||
end
|
||||
|
||||
def spree_forgot_password_path(opts = {})
|
||||
new_password_path(Spree.user_class.model_name.singular_route_key, opts)
|
||||
end
|
||||
|
||||
def spree_edit_password_path(opts = {})
|
||||
edit_registration_path(Spree.user_class.model_name.singular_route_key, opts)
|
||||
end
|
||||
|
||||
def spree_admin_login_path(opts = {})
|
||||
new_admin_user_session_path(opts)
|
||||
end
|
||||
|
||||
def spree_admin_logout_path(opts = {})
|
||||
destroy_admin_user_session_path(opts)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
ApplicationController.include Spree::AuthenticationHelpers if defined?(ApplicationController)
|
||||
0
lib/tasks/.keep
Normal file
0
lib/tasks/.keep
Normal file
Reference in New Issue
Block a user