fix: show descriptive error when creating local user with OIDC enabled
Return a JSON error body from UserAdminController instead of an empty 400, and extract API error messages in adminFetch so toasts display the reason. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -145,8 +145,9 @@ export default function UsersTab({ highlightId, onHighlightConsumed }: { highlig
|
||||
setNewPassword('');
|
||||
setNewProvider('local');
|
||||
},
|
||||
onError: () => {
|
||||
toast({ title: 'Failed to create user', variant: 'error', duration: 86_400_000 });
|
||||
onError: (err: unknown) => {
|
||||
const message = err instanceof Error ? err.message : 'Unknown error';
|
||||
toast({ title: 'Failed to create user', description: message, variant: 'error', duration: 86_400_000 });
|
||||
},
|
||||
},
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user