Enhanced error message on CSRF failure (#12788)

* Enhanced error message on CSRF failure

* Defer to 'detail' field if exists
This commit is contained in:
Oliver authored and GitHub committed 2026-09-05 19:55:37 +10:00
1 parent 0a4f095397
commit 9a416df5d4
3 files changed
+20 -15

No files matched your search

+4 -1
View File
@@ -20,7 +20,10 @@ export function extractErrorMessage({
let message = '';
if (error_data) {
message = error_data[field ?? 'error'] ?? error_data['non_field_errors'];
message =
error_data[field ?? 'error'] ??
error_data['detail'] ??
error_data['non_field_errors'];
}
// No message? Look at the response status codes