add isAdmin to auth state

This commit is contained in:
jeffvli
2025-12-07 17:21:46 -08:00
parent 2f2dbbde3e
commit 4ddada1fe3
10 changed files with 51 additions and 3 deletions
@@ -140,6 +140,7 @@ const LoginRoute = () => {
const serverItem: ServerListItemWithCredential = {
credential: data.credential,
id: nanoid(),
isAdmin: data.isAdmin,
name: serverName,
type: serverType as ServerType,
url: serverUrl.replace(/\/$/, ''),
@@ -156,6 +156,7 @@ export const AddServerForm = ({ onCancel }: AddServerFormProps) => {
const serverItem: ServerListItemWithCredential = {
credential: data.credential,
id: nanoid(),
isAdmin: data.isAdmin,
name: values.name,
type: values.type as ServerType,
url: values.url.replace(/\/$/, ''),
@@ -50,6 +50,7 @@ export const EditServerForm = ({ isUpdate, onCancel, password, server }: EditSer
const form = useForm({
initialValues: {
isAdmin: server?.isAdmin,
legacyAuth: false,
name: server?.name,
password: password || '',
@@ -94,6 +95,7 @@ export const EditServerForm = ({ isUpdate, onCancel, password, server }: EditSer
const serverItem: ServerListItemWithCredential = {
credential: data.credential,
id: server.id,
isAdmin: data.isAdmin,
name: values.name,
type: values.type,
url: values.url,