Merge branch 'master' of bitbucket.org:code2lab/sxrestaurant into adminbsb_ui_changes

This commit is contained in:
phyusin
2018-04-09 10:10:45 +06:30
7 changed files with 20 additions and 24 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -15,19 +15,16 @@ class BaseOrigamiController < ActionController::Base
redirect_to origami_dashboard_path redirect_to origami_dashboard_path
end end
def check_user def check_user
token_status = false if check_mobile
authenticate_with_http_token do |token, options|
if token
token_status = true
session[:webview] = true
session[:session_token] = token
end
end
if !token_status
if current_user.nil? if current_user.nil?
redirect_to root_path 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 end
@@ -49,9 +46,13 @@ class BaseOrigamiController < ActionController::Base
#check webview #check webview
def check_mobile def check_mobile
status = false status = false
puts "check mobile" authenticate_with_http_token do |token, options|
puts session[:session_token] if token
puts session[:webview] session[:webview] = true
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
status = true status = true
end end

View File

@@ -9,7 +9,7 @@ module TokenVerification
protected protected
# Authenticate the user with token based authentication # Authenticate the user with token based authentication
def authenticate def authenticate
authenticate_token || render_unauthorized authenticate_token || render_unauthorized
end end