tokens: Allow authenticators to send an error message

This commit is contained in:
Alexander Larsson
2019-11-07 10:11:45 +01:00
committed by Alexander Larsson
parent b77f7c9383
commit e0cef17c0c

View File

@@ -2834,7 +2834,13 @@ request_tokens_for_remote (FlatpakTransaction *self,
}
if (data.response != FLATPAK_AUTH_RESPONSE_OK)
return flatpak_fail (error, "Failed to get tokens for ref");
{
const char *error_message = NULL;
if (g_variant_lookup (results, "error-message", "&s", &error_message))
return flatpak_fail (error, "Failed to get tokens for ref: %s", error_message);
else
return flatpak_fail (error, "Failed to get tokens for ref");
}
tokens = g_variant_lookup_value (results, "tokens", G_VARIANT_TYPE ("a{sas}"));
if (tokens == NULL)