mirror of
https://github.com/steveiliop56/tinyauth.git
synced 2025-10-27 20:25:41 +00:00
refactor: change basic auth label to username instead of user
This commit is contained in:
@@ -154,9 +154,9 @@ func (h *Handlers) AuthHandler(c *gin.Context) {
|
||||
log.Debug().Str("key", key).Msg("Setting header")
|
||||
c.Header(key, value)
|
||||
}
|
||||
if labels.Basic.User != "" && labels.Basic.Password != "" {
|
||||
log.Debug().Str("username", labels.Basic.User).Msg("Setting basic auth headers")
|
||||
c.Header("Authorization", fmt.Sprintf("Basic %s", utils.GetBasicAuth(labels.Basic.User, labels.Basic.Password)))
|
||||
if labels.Basic.Username != "" && labels.Basic.Password != "" {
|
||||
log.Debug().Str("username", labels.Basic.Username).Msg("Setting basic auth headers")
|
||||
c.Header("Authorization", fmt.Sprintf("Basic %s", utils.GetBasicAuth(labels.Basic.Username, labels.Basic.Password)))
|
||||
}
|
||||
c.JSON(200, gin.H{
|
||||
"status": 200,
|
||||
@@ -283,9 +283,9 @@ func (h *Handlers) AuthHandler(c *gin.Context) {
|
||||
}
|
||||
|
||||
// Set basic auth headers if configured
|
||||
if labels.Basic.User != "" && labels.Basic.Password != "" {
|
||||
log.Debug().Str("username", labels.Basic.User).Msg("Setting basic auth headers")
|
||||
c.Header("Authorization", fmt.Sprintf("Basic %s", utils.GetBasicAuth(labels.Basic.User, labels.Basic.Password)))
|
||||
if labels.Basic.Username != "" && labels.Basic.Password != "" {
|
||||
log.Debug().Str("username", labels.Basic.Username).Msg("Setting basic auth headers")
|
||||
c.Header("Authorization", fmt.Sprintf("Basic %s", utils.GetBasicAuth(labels.Basic.Username, labels.Basic.Password)))
|
||||
}
|
||||
|
||||
// The user is allowed to access the app
|
||||
|
||||
@@ -108,7 +108,7 @@ type OAuthLabels struct {
|
||||
|
||||
// Basic auth labels for a tinyauth protected container
|
||||
type BasicLabels struct {
|
||||
User string
|
||||
Username string
|
||||
Password string
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user