@avelonjs/neon 0.3.1 → 0.3.3
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/package.json +1 -1
- package/src/identity/errors.ts +8 -1
package/package.json
CHANGED
package/src/identity/errors.ts
CHANGED
|
@@ -105,6 +105,8 @@ export interface AuthFailure {
|
|
|
105
105
|
readonly code: string | undefined
|
|
106
106
|
/** Vendor message, already falling back to the caller's wording. */
|
|
107
107
|
readonly message: string
|
|
108
|
+
/** URL the driver called, so a rejected path names itself. */
|
|
109
|
+
readonly url: string
|
|
108
110
|
}
|
|
109
111
|
|
|
110
112
|
/**
|
|
@@ -122,6 +124,7 @@ export function describeAuthFailure(
|
|
|
122
124
|
status: response.status,
|
|
123
125
|
code: authErrorCode(body.json),
|
|
124
126
|
message: message ?? `${fallback} Neon Auth returned HTTP ${response.status}.`,
|
|
127
|
+
url: response.url,
|
|
125
128
|
}
|
|
126
129
|
}
|
|
127
130
|
|
|
@@ -167,8 +170,12 @@ export function mapAuthError(
|
|
|
167
170
|
}
|
|
168
171
|
|
|
169
172
|
// Better Auth serves every documented path; a 404 or 405 means the configured URL is not one.
|
|
173
|
+
// The vendor's wording for it names nothing, so the URL that produced it goes in the message.
|
|
170
174
|
if (status === 404 || status === 405) {
|
|
171
|
-
throw new Unavailable(message
|
|
175
|
+
throw new Unavailable(`${message} (${options.operation} called ${failure.url})`, {
|
|
176
|
+
metadata: { service: 'identity' },
|
|
177
|
+
cause,
|
|
178
|
+
})
|
|
172
179
|
}
|
|
173
180
|
|
|
174
181
|
if (WEAK_PASSWORD_CODES.has(code ?? '')) {
|