Skip to content

Instantly share code, notes, and snippets.

@muratatak77
Created August 13, 2016 02:03
Show Gist options
  • Save muratatak77/c18ad4eae3b5768aac3cae3ef614761f to your computer and use it in GitHub Desktop.
Save muratatak77/c18ad4eae3b5768aac3cae3ef614761f to your computer and use it in GitHub Desktop.
before_action do |controller| HTTP_USER_AGENT
## If specific android
# before_action do |controller|
# agent = request.env['HTTP_USER_AGENT']
# puts "agent :::: #{agent}"
# if request.env['HTTP_USER_AGENT'].downcase.match(/iphone/)
# puts "iphone geldi. JWT check ..."
# jwt_validation
# elsif request.env['HTTP_USER_AGENT'].downcase.match(/android/)
# puts "Android geldi. Serbest gecis ....."
# else
# if (params[:action] == "index" || params[:action] == "os_type" || params[:action] == "show")
# jwt_validation
# end
# end
# end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment