@tempoxyz/auth 0.0.0-pr-28.sha-93a5e08 → 0.0.0-pr-28.sha-72f7afa
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/internal/api.js +4 -1
- package/package.json +1 -1
package/dist/internal/api.js
CHANGED
|
@@ -29,9 +29,12 @@ export function authorization(body, options) {
|
|
|
29
29
|
export async function json(response) {
|
|
30
30
|
// Some refusals, such as the CSRF check's, answer plain text.
|
|
31
31
|
const body = (await response.json().catch(() => ({})));
|
|
32
|
+
// OAuth-style refusals, such as the device grant's, put the explanation beside a code.
|
|
32
33
|
if (!response.ok)
|
|
33
34
|
throw new RequestError({
|
|
34
|
-
message: body.
|
|
35
|
+
message: body.error_description ??
|
|
36
|
+
body.error ??
|
|
37
|
+
`Request failed with status ${response.status}.`,
|
|
35
38
|
status: response.status,
|
|
36
39
|
});
|
|
37
40
|
return body;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tempoxyz/auth",
|
|
3
|
-
"version": "0.0.0-pr-28.sha-
|
|
3
|
+
"version": "0.0.0-pr-28.sha-72f7afa",
|
|
4
4
|
"description": "Signs users in to Tempo through Tempo Auth, and returns viem access key accounts on their Tempo Accounts.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|