From 1a64a737d4c160de7b2eece50fde918e50e7aca1 Mon Sep 17 00:00:00 2001 From: luisramos0 Date: Sat, 6 Jul 2019 10:50:41 +0100 Subject: [PATCH] Add ActionController::Metal frorm spree_auth_devise for api authentication --- app/controllers/metal_decorator.rb | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 app/controllers/metal_decorator.rb diff --git a/app/controllers/metal_decorator.rb b/app/controllers/metal_decorator.rb new file mode 100644 index 0000000000..18ec22e4c8 --- /dev/null +++ b/app/controllers/metal_decorator.rb @@ -0,0 +1,6 @@ +# For the API +ActionController::Metal.class_eval do + def spree_current_user + @spree_current_user ||= env['warden'].user + end +end