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,17 +85,26 @@ function SetupView() {
|
|||||||
initialValues={{username: '', email: '', password: '', passwordRepeat: ''}}
|
initialValues={{username: '', email: '', password: '', passwordRepeat: ''}}
|
||||||
onSubmit={
|
onSubmit={
|
||||||
async (values: any) => {
|
async (values: any) => {
|
||||||
await SetupEndpoint.registerSuperAdmin({
|
try {
|
||||||
username: values.username,
|
await SetupEndpoint.registerSuperAdmin({
|
||||||
password: values.password,
|
username: values.username,
|
||||||
email: values.email
|
password: values.password,
|
||||||
});
|
email: values.email
|
||||||
addToast({
|
});
|
||||||
title: "Setup finished",
|
addToast({
|
||||||
description: "Have fun with Gameyfin!",
|
title: "Setup finished",
|
||||||
color: "success"
|
description: "Have fun with Gameyfin!",
|
||||||
})
|
color: "success"
|
||||||
navigate('/login');
|
});
|
||||||
|
} catch (e) {
|
||||||
|
addToast({
|
||||||
|
title: "Could not register super admin user",
|
||||||
|
description: "Maybe Gameyfin is already set up?",
|
||||||
|
color: "warning"
|
||||||
|
});
|
||||||
|
} finally {
|
||||||
|
navigate('/login');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
|
|||||||
Reference in New Issue
Block a user