mirror of
https://github.com/BrenBroZAYT/gameyfin.git
synced 2026-06-13 16:40:01 +00:00
Handle error case in setup (fixes #723)
This commit is contained in:
@@ -85,6 +85,7 @@ function SetupView() {
|
||||
initialValues={{username: '', email: '', password: '', passwordRepeat: ''}}
|
||||
onSubmit={
|
||||
async (values: any) => {
|
||||
try {
|
||||
await SetupEndpoint.registerSuperAdmin({
|
||||
username: values.username,
|
||||
password: values.password,
|
||||
@@ -94,10 +95,18 @@ function SetupView() {
|
||||
title: "Setup finished",
|
||||
description: "Have fun with Gameyfin!",
|
||||
color: "success"
|
||||
})
|
||||
});
|
||||
} catch (e) {
|
||||
addToast({
|
||||
title: "Could not register super admin user",
|
||||
description: "Maybe Gameyfin is already set up?",
|
||||
color: "warning"
|
||||
});
|
||||
} finally {
|
||||
navigate('/login');
|
||||
}
|
||||
}
|
||||
}
|
||||
>
|
||||
<WizardStep icon={<HandWaving/>}>
|
||||
<WelcomeStep/>
|
||||
|
||||
Reference in New Issue
Block a user