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
#Description
# Pull the default menu details and also other available (active) menus
# Input Params - order_id

View File

@@ -1,5 +1,4 @@
class Api::Restaurant::MenuCategoriesController < Api::ApiController
skip_before_action :authenticate
class Api::Restaurant::MenuCategoriesController < Api::ApiController
#Description
# Pull the default menu details and also other available (active) menus
# Input Params - order_id

View File

@@ -1,5 +1,4 @@
class Api::Restaurant::MenuController < Api::ApiController
skip_before_action :authenticate
#Description
# Pull the default menu details and also other available (active) menus
# Input Params - order_id

View File

@@ -1,5 +1,4 @@
class Api::Restaurant::MenuItemAttributesController < Api::ApiController
skip_before_action :authenticate
class Api::Restaurant::MenuItemAttributesController < Api::ApiController
#Description
# Pull the default menu details and also other available (active) menus
# Input Params - order_id

View File

@@ -1,5 +1,4 @@
class Api::Restaurant::MenuItemInstancesController < Api::ApiController
skip_before_action :authenticate
class Api::Restaurant::MenuItemInstancesController < Api::ApiController
#Description
# Pull the default menu details and also other available (active) menus
# Input Params - order_id

View File

@@ -15,19 +15,16 @@ class BaseOrigamiController < ActionController::Base
redirect_to origami_dashboard_path
end
def check_user
token_status = false
authenticate_with_http_token do |token, options|
if token
token_status = true
session[:webview] = true
session[:session_token] = token
end
end
if !token_status
def check_user
if check_mobile
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
@@ -49,9 +46,13 @@ class BaseOrigamiController < ActionController::Base
#check webview
def check_mobile
status = false
puts "check mobile"
puts session[:session_token]
puts session[:webview]
authenticate_with_http_token do |token, options|
if token
session[:webview] = true
session[:session_token] = token
end
end
if session[:webview] && request.user_agent =~ /android|blackberry|iphone|ipad|ipod|iemobile|mobile|webos/i
status = true
end

View File

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