handle errors more gracefully

This commit is contained in:
peintnermax
2024-08-21 16:08:37 +02:00
parent 775ead416c
commit 96ec3162d8
4 changed files with 38 additions and 43 deletions

View File

@@ -115,27 +115,12 @@ export default async function Page({
);
}
}
} else if (options?.isCreationAllowed && options.isAutoCreation) {
const userId = await createUser(provider, idpInformation).catch(
(error) => {
return (
<DynamicTheme branding={branding}>
<div className="flex flex-col items-center space-y-4">
<h1>Register failed</h1>
<div className="w-full">
{
<Alert type={AlertType.ALERT}>
{JSON.stringify(error.message)}
</Alert>
}
</div>
</div>
</DynamicTheme>
);
},
);
}
if (userId) {
if (options?.isCreationAllowed && options.isAutoCreation) {
const newUser = await createUser(provider, idpInformation);
if (newUser) {
return (
<DynamicTheme branding={branding}>
<div className="flex flex-col items-center space-y-4">