Change to not require `magic-public-key` on WebFinger
This commit is contained in:
parent
e818381042
commit
ac27b94ffa
|
@ -86,11 +86,17 @@ def represent_user(user, "XML") do
|
||||||
|> XmlBuilder.to_doc()
|
|> XmlBuilder.to_doc()
|
||||||
end
|
end
|
||||||
|
|
||||||
defp get_magic_key(magic_key) do
|
defp get_magic_key("data:application/magic-public-key," <> magic_key) do
|
||||||
"data:application/magic-public-key," <> magic_key = magic_key
|
|
||||||
{:ok, magic_key}
|
{:ok, magic_key}
|
||||||
rescue
|
end
|
||||||
MatchError -> {:error, "Missing magic key data."}
|
|
||||||
|
defp get_magic_key(nil) do
|
||||||
|
Logger.debug("Undefined magic key.")
|
||||||
|
{:ok, nil}
|
||||||
|
end
|
||||||
|
|
||||||
|
defp get_magic_key(_) do
|
||||||
|
{:error, "Missing magic key data."}
|
||||||
end
|
end
|
||||||
|
|
||||||
defp webfinger_from_xml(doc) do
|
defp webfinger_from_xml(doc) do
|
||||||
|
|
Loading…
Reference in New Issue