{ const target = _user; try { const key = await rotateUserAPIKeyById(localStorage.token, selectedUser.id); if (show && target === _user) rotatedAPIKey = key; toast.success($i18n.t('API Key created.')); } catch (error) { toast.error(error instanceof Error ? error.message : String(error)); } }} /> { const target = _user; try { await deleteUserAPIKeyById(localStorage.token, selectedUser.id); if (target === _user) rotatedAPIKey = ''; toast.success($i18n.t('API Key deleted.')); } catch (error) { toast.error(error instanceof Error ? error.message : String(error)); } }} /> { try { await revokeUserSessions(localStorage.token, selectedUser.id); toast.success($i18n.t('All sessions revoked')); } catch (error) { toast.error(error instanceof Error ? error.message : String(error)); } }} />
{$i18n.t('Edit User')}
{ submitHandler(); }} >
{selectedUser.name}
{$i18n.t('Created at')} {dayjs(selectedUser.created_at * 1000) .locale($i18n.language) .format('LL')}
{#if (userGroups ?? []).length > 0}
{$i18n.t('User Groups')}
{/if}
{$i18n.t('Role')}
{$i18n.t('Name')}
{$i18n.t('Email')}
{#if _user?.oauth}
{$i18n.t('OAuth ID')}
{#each Object.keys(_user.oauth) as key}
{key} {_user.oauth[key]?.sub}
{/each}
{/if}
{$i18n.t('New Password')}
{$i18n.t('API Key')}
{#if rotatedAPIKey}

{$i18n.t( 'Copy this key now. It will not be shown here again after you close this dialog.' )}

{/if}