remove skip auth from api and check user modified
This commit is contained in:
@@ -1,5 +1,4 @@
|
|||||||
class Api::Restaurant::ItemSetsController < Api::ApiController
|
class Api::Restaurant::ItemSetsController < Api::ApiController
|
||||||
|
|
||||||
#Description
|
#Description
|
||||||
# Pull the default menu details and also other available (active) menus
|
# Pull the default menu details and also other available (active) menus
|
||||||
# Input Params - order_id
|
# Input Params - order_id
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
class Api::Restaurant::MenuCategoriesController < Api::ApiController
|
class Api::Restaurant::MenuCategoriesController < Api::ApiController
|
||||||
skip_before_action :authenticate
|
|
||||||
#Description
|
#Description
|
||||||
# Pull the default menu details and also other available (active) menus
|
# Pull the default menu details and also other available (active) menus
|
||||||
# Input Params - order_id
|
# Input Params - order_id
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
class Api::Restaurant::MenuController < Api::ApiController
|
class Api::Restaurant::MenuController < Api::ApiController
|
||||||
skip_before_action :authenticate
|
|
||||||
#Description
|
#Description
|
||||||
# Pull the default menu details and also other available (active) menus
|
# Pull the default menu details and also other available (active) menus
|
||||||
# Input Params - order_id
|
# Input Params - order_id
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
class Api::Restaurant::MenuItemAttributesController < Api::ApiController
|
class Api::Restaurant::MenuItemAttributesController < Api::ApiController
|
||||||
skip_before_action :authenticate
|
|
||||||
#Description
|
#Description
|
||||||
# Pull the default menu details and also other available (active) menus
|
# Pull the default menu details and also other available (active) menus
|
||||||
# Input Params - order_id
|
# Input Params - order_id
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
class Api::Restaurant::MenuItemInstancesController < Api::ApiController
|
class Api::Restaurant::MenuItemInstancesController < Api::ApiController
|
||||||
skip_before_action :authenticate
|
|
||||||
#Description
|
#Description
|
||||||
# Pull the default menu details and also other available (active) menus
|
# Pull the default menu details and also other available (active) menus
|
||||||
# Input Params - order_id
|
# Input Params - order_id
|
||||||
|
|||||||
@@ -16,8 +16,16 @@ class BaseOrigamiController < ActionController::Base
|
|||||||
end
|
end
|
||||||
|
|
||||||
def check_user
|
def check_user
|
||||||
if current_user.nil?
|
if check_mobile
|
||||||
redirect_to root_path
|
if current_user.nil?
|
||||||
|
return render status: 401, json: {
|
||||||
|
message: "User using other device!"
|
||||||
|
}.to_json
|
||||||
|
end
|
||||||
|
else
|
||||||
|
if current_user.nil?
|
||||||
|
redirect_to root_path
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -41,8 +49,8 @@ class BaseOrigamiController < ActionController::Base
|
|||||||
authenticate_with_http_token do |token, options|
|
authenticate_with_http_token do |token, options|
|
||||||
if token
|
if token
|
||||||
session[:webview] = true
|
session[:webview] = true
|
||||||
|
session[:session_token] = token
|
||||||
end
|
end
|
||||||
session[:session_token] = token
|
|
||||||
end
|
end
|
||||||
|
|
||||||
if session[:webview] && request.user_agent =~ /android|blackberry|iphone|ipad|ipod|iemobile|mobile|webos/i
|
if session[:webview] && request.user_agent =~ /android|blackberry|iphone|ipad|ipod|iemobile|mobile|webos/i
|
||||||
|
|||||||
Reference in New Issue
Block a user