mirror of
https://github.com/steveiliop56/tinyauth.git
synced 2025-10-28 20:55:42 +00:00
Compare commits
2 Commits
v2.0.0-bet
...
v2.0.1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c54267f50d | ||
|
|
4de12ce5c1 |
3
.gitignore
vendored
3
.gitignore
vendored
@@ -11,4 +11,5 @@ docker-compose.test.yml
|
||||
users.txt
|
||||
|
||||
# secret test file
|
||||
secret.txt
|
||||
secret.txt
|
||||
secret_oauth.txt
|
||||
@@ -1 +1 @@
|
||||
v2.0.0
|
||||
v2.0.1
|
||||
@@ -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,
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user