fix: it was possible to go to the create user page when credentials login disabled (#1217)

This commit is contained in:
Meier Lukas
2024-10-02 10:41:14 +02:00
committed by GitHub
parent 2f3619b68d
commit d63f6d270f
3 changed files with 21 additions and 7 deletions

View File

@@ -1,4 +1,5 @@
import { api } from "@homarr/api/server";
import { isProviderEnabled } from "@homarr/auth/server";
import { getScopedI18n } from "@homarr/translation/server";
import { DynamicBreadcrumb } from "~/components/navigation/dynamic-breadcrumb";
@@ -15,10 +16,12 @@ export async function generateMetadata() {
export default async function UsersPage() {
const userList = await api.user.getAll();
const credentialsProviderEnabled = isProviderEnabled("credentials");
return (
<>
<DynamicBreadcrumb />
<UserListComponent initialUserList={userList} />
<UserListComponent initialUserList={userList} credentialsProviderEnabled={credentialsProviderEnabled} />
</>
);
}