remove skip auth from api and check user modified
This commit is contained in:
@@ -15,9 +15,17 @@ class BaseOrigamiController < ActionController::Base
|
||||
redirect_to origami_dashboard_path
|
||||
end
|
||||
|
||||
def check_user
|
||||
if current_user.nil?
|
||||
redirect_to root_path
|
||||
def check_user
|
||||
if check_mobile
|
||||
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
|
||||
|
||||
@@ -41,8 +49,8 @@ class BaseOrigamiController < ActionController::Base
|
||||
authenticate_with_http_token do |token, options|
|
||||
if token
|
||||
session[:webview] = true
|
||||
end
|
||||
session[:session_token] = token
|
||||
session[:session_token] = token
|
||||
end
|
||||
end
|
||||
|
||||
if session[:webview] && request.user_agent =~ /android|blackberry|iphone|ipad|ipod|iemobile|mobile|webos/i
|
||||
|
||||
Reference in New Issue
Block a user