summaryrefslogtreecommitdiff
path: root/internal/middlewares/authelia_context.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/middlewares/authelia_context.go')
-rw-r--r--internal/middlewares/authelia_context.go7
1 files changed, 6 insertions, 1 deletions
diff --git a/internal/middlewares/authelia_context.go b/internal/middlewares/authelia_context.go
index 7afa86961..c4f8a2274 100644
--- a/internal/middlewares/authelia_context.go
+++ b/internal/middlewares/authelia_context.go
@@ -32,6 +32,7 @@ func NewAutheliaCtx(ctx *fasthttp.RequestCtx, configuration schema.Configuration
autheliaCtx.Configuration = configuration
autheliaCtx.Logger = NewRequestLogger(autheliaCtx)
autheliaCtx.Clock = utils.RealClock{}
+
return autheliaCtx, nil
}
@@ -44,6 +45,7 @@ func AutheliaMiddleware(configuration schema.Configuration, providers Providers)
autheliaCtx.Error(err, operationFailedMessage)
return
}
+
next(autheliaCtx)
}
}
@@ -78,7 +80,6 @@ func (c *AutheliaCtx) ReplyError(err error, message string) {
// ReplyUnauthorized response sent when user is unauthorized.
func (c *AutheliaCtx) ReplyUnauthorized() {
c.RequestCtx.Error(fasthttp.StatusMessage(fasthttp.StatusUnauthorized), fasthttp.StatusUnauthorized)
- // c.Response.Header.Set("WWW-Authenticate", "Basic realm=Restricted")
}
// ReplyForbidden response sent when access is forbidden to user.
@@ -113,6 +114,7 @@ func (c *AutheliaCtx) GetSession() session.UserSession {
c.Logger.Error("Unable to retrieve user session")
return session.NewDefaultUserSession()
}
+
return userSession
}
@@ -144,6 +146,7 @@ func (c *AutheliaCtx) ParseBody(value interface{}) error {
if !valid {
return fmt.Errorf("Body is not valid")
}
+
return nil
}
@@ -156,6 +159,7 @@ func (c *AutheliaCtx) SetJSONBody(value interface{}) error {
c.SetContentType("application/json")
c.SetBody(b)
+
return nil
}
@@ -169,5 +173,6 @@ func (c *AutheliaCtx) RemoteIP() net.IP {
return net.ParseIP(strings.Trim(ips[0], " "))
}
}
+
return c.RequestCtx.RemoteIP()
}