1
0
mirror of https://github.com/danbee/micropub.git synced 2025-03-04 08:59:13 +00:00

Grab access token from form params if it's not in a header

This commit is contained in:
Daniel Barber 2019-11-16 22:30:06 -05:00
parent c5532e23d4
commit fa0ee16991
Signed by: danbarber
GPG Key ID: 931D8112E0103DD8

View File

@ -56,6 +56,7 @@ module Micropub
token = Indieauth::Token.new(endpoints.token_endpoint)
auth_type, auth_token = request.env["HTTP_AUTHORIZATION"]&.split(" ")
auth_token ||= params["access_token"]
auth_type == "Bearer" && token.validate(auth_token)
end