From 927913cf4e0a6e4f3a6b7dbf9ae9034d0780b5fb Mon Sep 17 00:00:00 2001 From: Meier Lukas Date: Fri, 17 Jan 2025 16:11:50 +0100 Subject: [PATCH] fix: add error from ldap bind operation to log statement (#1980) --- .../credentials/authorization/ldap-authorization.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/auth/providers/credentials/authorization/ldap-authorization.ts b/packages/auth/providers/credentials/authorization/ldap-authorization.ts index bf793ba05..84f59e989 100644 --- a/packages/auth/providers/credentials/authorization/ldap-authorization.ts +++ b/packages/auth/providers/credentials/authorization/ldap-authorization.ts @@ -1,5 +1,6 @@ import { CredentialsSignin } from "@auth/core/errors"; +import { extractErrorMessage } from "@homarr/common"; import type { Database, InferInsertModel } from "@homarr/db"; import { and, createId, eq } from "@homarr/db"; import { users } from "@homarr/db/schema"; @@ -21,8 +22,8 @@ export const authorizeWithLdapCredentialsAsync = async ( distinguishedName: env.AUTH_LDAP_BIND_DN, password: env.AUTH_LDAP_BIND_PASSWORD, }) - .catch(() => { - logger.error("Failed to connect to LDAP server"); + .catch((error) => { + logger.error(`Failed to connect to LDAP server ${extractErrorMessage(error)}`); throw new CredentialsSignin(); });