Compare commits

..

2 Commits

Author SHA1 Message Date
Stavros
c54267f50d fix: parse users correctly 2025-01-26 22:40:55 +02:00
Stavros
4de12ce5c1 fix: no need to log that the provider is empty 2025-01-26 21:36:41 +02:00
4 changed files with 7 additions and 5 deletions

3
.gitignore vendored
View File

@@ -11,4 +11,5 @@ docker-compose.test.yml
users.txt
# secret test file
secret.txt
secret.txt
secret_oauth.txt

View File

@@ -1 +1 @@
v2.0.0
v2.0.1

View File

@@ -73,7 +73,6 @@ func (hooks *Hooks) UseUserContext(c *gin.Context) types.UserContext {
}
}
log.Error().Msg("Provider does not exist")
return types.UserContext{
Username: "",
IsLoggedIn: false,

View File

@@ -77,7 +77,7 @@ func ParseFileToLine(content string) string {
continue
}
users = append(users, line)
users = append(users, strings.TrimSpace(line))
}
return strings.Join(users, ",")
@@ -122,7 +122,9 @@ func GetUsers(env string, file string) (types.Users, error) {
if fileErr == nil {
log.Debug().Str("users", ParseFileToLine(fileContents)).Msg("Using users from file")
users += ","
if users != "" {
users += ","
}
users += ParseFileToLine(fileContents)
}
}