mirror of
https://github.com/Alvin-Zilverstand/nginx-proxy-manager.git
synced 2026-11-25 15:43:14 +01:00
Adds LDAP auth support
This commit is contained in:
54 files changed
+765
-306
No files matched your search
@@ -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