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

Compare commits

..

1 Commits

Author SHA1 Message Date
b86481345a The IndieWeb API has changed 2022-08-16 22:29:44 -05:00
2 changed files with 3 additions and 2 deletions

View File

@ -55,7 +55,7 @@ module Micropub
end
def valid_token?
token = Indieauth::Token.new(endpoints[:token_endpoint])
token = Indieauth::Token.new(endpoints.token_endpoint)
_, auth_token = request.env["HTTP_AUTHORIZATION"]&.split(" ")
auth_token ||= params["access_token"]

View File

@ -3,7 +3,8 @@ require "request_helper"
describe "auth" do
before(:each) do
@auth_token = "123abc"
endpoints = { token_endpoint: "" }
endpoints = mock("Indieauth::Endpoints")
endpoints.stubs(:token_endpoint)
Indieauth::Endpoints.stubs(:new).returns endpoints
Indieauth::Token.any_instance.stubs(:validate).returns(false)
Indieauth::Token.any_instance.stubs(:validate).