mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-03-03 14:50:19 +01:00
Merge branch 'main' into feat/Multitenant-login-OIDC
This commit is contained in:
commit
c14751cef5
417 changed files with 28394 additions and 9012 deletions
|
|
@ -6,7 +6,7 @@ const getProfileDetails = ({ profile }) => ({
|
|||
id: profile.id,
|
||||
avatarUrl: profile.photos[0].value,
|
||||
username: profile.name.givenName,
|
||||
name: `${profile.name.givenName} ${profile.name.familyName}`,
|
||||
name: `${profile.name.givenName}${profile.name.familyName ? ` ${profile.name.familyName}` : ''}`,
|
||||
emailVerified: profile.emails[0].verified,
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ const jwtLogin = async () =>
|
|||
},
|
||||
async (payload, done) => {
|
||||
try {
|
||||
const user = await getUserById(payload?.id, '-password -__v');
|
||||
const user = await getUserById(payload?.id, '-password -__v -totpSecret');
|
||||
if (user) {
|
||||
user.id = user._id.toString();
|
||||
if (!user.role) {
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@ const {
|
|||
LDAP_USERNAME,
|
||||
LDAP_EMAIL,
|
||||
LDAP_TLS_REJECT_UNAUTHORIZED,
|
||||
LDAP_STARTTLS,
|
||||
} = process.env;
|
||||
|
||||
// Check required environment variables
|
||||
|
|
@ -50,6 +51,7 @@ if (LDAP_EMAIL) {
|
|||
searchAttributes.push(LDAP_EMAIL);
|
||||
}
|
||||
const rejectUnauthorized = isEnabled(LDAP_TLS_REJECT_UNAUTHORIZED);
|
||||
const startTLS = isEnabled(LDAP_STARTTLS);
|
||||
|
||||
const ldapOptions = {
|
||||
server: {
|
||||
|
|
@ -72,6 +74,7 @@ const ldapOptions = {
|
|||
})(),
|
||||
},
|
||||
}),
|
||||
...(startTLS && { starttls: true }),
|
||||
},
|
||||
usernameField: 'email',
|
||||
passwordField: 'password',
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue