check mobile user

This commit is contained in:
phyusin
2018-04-05 19:22:52 +06:30
parent 6c172eae8e
commit 8217b7c2f2

View File

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