mirror of
https://github.com/NginxProxyManager/nginx-proxy-manager.git
synced 2025-07-05 01:09:37 +00:00
Adds LDAP auth support
This commit is contained in:
@ -11,7 +11,7 @@ func GetByID(id int) (Model, error) {
|
||||
return m, err
|
||||
}
|
||||
|
||||
// GetByUserIDType finds a user by email
|
||||
// GetByUserIDType finds a user by id and type
|
||||
func GetByUserIDType(userID uint, authType string) (Model, error) {
|
||||
var auth Model
|
||||
db := database.GetDB()
|
||||
@ -21,3 +21,14 @@ func GetByUserIDType(userID uint, authType string) (Model, error) {
|
||||
First(&auth)
|
||||
return auth, result.Error
|
||||
}
|
||||
|
||||
// GetByUserIDType finds a user by id and type
|
||||
func GetByIdenityType(identity string, authType string) (Model, error) {
|
||||
var auth Model
|
||||
db := database.GetDB()
|
||||
result := db.
|
||||
Where("identity = ?", identity).
|
||||
Where("type = ?", authType).
|
||||
First(&auth)
|
||||
return auth, result.Error
|
||||
}
|
||||
|
Reference in New Issue
Block a user