feat: Add custom fields & role assignment to OpenID strategy (#5612)

* started with Support for Customizable OpenID Profile Fields via Environment Variable

* kept as much of the original code as possible but still added the custom data mapper

* kept as much of the original code as possible but still added the custom data mapper

* resolved merge conflicts

* resolved merge conflicts

* resolved merge conflicts

* resolved merge conflicts

* removed some unneeded comments

* fix: conflicted issue

---------

Co-authored-by: Talstra Ruben SRSNL <ruben.talstra@stadlerrail.com>
This commit is contained in:
Ruben Talstra 2025-02-11 16:42:05 +01:00 committed by GitHub
parent 404b27d045
commit 2ef6e4462d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 250 additions and 2 deletions

View file

@ -20,6 +20,7 @@ const { SystemRoles } = require('librechat-data-provider');
* @property {string} [googleId] - Optional Google ID for the user
* @property {string} [facebookId] - Optional Facebook ID for the user
* @property {string} [openidId] - Optional OpenID ID for the user
* @property {Map<string, string>} [customOpenIdData] - A map containing provider-specific custom data retrieved via OpenID Connect.
* @property {string} [ldapId] - Optional LDAP ID for the user
* @property {string} [githubId] - Optional GitHub ID for the user
* @property {string} [discordId] - Optional Discord ID for the user
@ -97,6 +98,11 @@ const userSchema = mongoose.Schema(
unique: true,
sparse: true,
},
customOpenIdData: {
type: Map,
of: mongoose.Schema.Types.Mixed,
default: {},
},
ldapId: {
type: String,
unique: true,