@avelonjs/supabase 0.3.2 → 0.3.4
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
|
@@ -120,6 +120,8 @@ export interface AuthFailure {
|
|
|
120
120
|
readonly code: string | undefined
|
|
121
121
|
/** Vendor message, already falling back to the caller's wording. */
|
|
122
122
|
readonly message: string
|
|
123
|
+
/** URL the driver called, so a rejected path names itself. */
|
|
124
|
+
readonly url: string
|
|
123
125
|
}
|
|
124
126
|
|
|
125
127
|
/**
|
|
@@ -138,6 +140,7 @@ export function describeAuthFailure(
|
|
|
138
140
|
status: response.status,
|
|
139
141
|
code: authErrorCode(body.json),
|
|
140
142
|
message: message ?? `${fallback} Supabase Auth returned HTTP ${response.status}.`,
|
|
143
|
+
url: response.url,
|
|
141
144
|
}
|
|
142
145
|
}
|
|
143
146
|
|
|
@@ -192,8 +195,12 @@ export function mapAuthError(
|
|
|
192
195
|
}
|
|
193
196
|
|
|
194
197
|
// GoTrue serves every documented path; a 404 or 405 means the configured auth URL is not one.
|
|
198
|
+
// The vendor's wording for it names nothing, so the URL that produced it goes in the message.
|
|
195
199
|
if (status === 404 || status === 405) {
|
|
196
|
-
throw new Unavailable(message
|
|
200
|
+
throw new Unavailable(`${message} (${options.operation} called ${failure.url})`, {
|
|
201
|
+
metadata: { service: 'identity' },
|
|
202
|
+
cause,
|
|
203
|
+
})
|
|
197
204
|
}
|
|
198
205
|
|
|
199
206
|
if (DISABLED_CODES.has(code ?? '')) {
|