lib/opro/controllers/application_controller_helper.rb in opro-0.3.3 vs lib/opro/controllers/application_controller_helper.rb in opro-0.4.0
- old
+ new
@@ -64,10 +64,10 @@
end
# grabs access_token from header if one is present
def oauth_access_token_from_header
auth_header = request.env["HTTP_AUTHORIZATION"]||""
- match = auth_header.match(/^token\s(.*)/) || auth_header.match(/^Bearer\s(.*)/)
+ match = auth_header.match(/token\W*([^\W]*)/) || auth_header.match(/^Bearer\s(.*)/) || auth_header.match(Opro.header_auth_regex)
return match[1] if match.present?
false
end
def oauth?