From 8217b7c2f27f5b38b27425929d01b789da0583fd Mon Sep 17 00:00:00 2001 From: phyusin Date: Thu, 5 Apr 2018 19:22:52 +0630 Subject: [PATCH] check mobile user --- app/controllers/base_origami_controller.rb | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/app/controllers/base_origami_controller.rb b/app/controllers/base_origami_controller.rb index 828d0787..b627ae01 100755 --- a/app/controllers/base_origami_controller.rb +++ b/app/controllers/base_origami_controller.rb @@ -38,15 +38,14 @@ class BaseOrigamiController < ActionController::Base #check webview def check_mobile status = false - token_status = false authenticate_with_http_token do |token, options| if token - token_status = true + session[:webview] = true end session[:session_token] = token end - if token_status && 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 end