mirror of
https://github.com/mickael-kerjean/filestash
synced 2025-12-06 08:22:24 +01:00
feature (log): log auth failure - #852
We want to have a warning so that it is possible from the logs to immediately see if there have been failed logging attempts. This might allow in the future to set up tools like fail2ban. Co-authored-by: Marco Seravalli <me@marcoseravalli.com>
This commit is contained in:
parent
ca68df76ab
commit
609fc607c2
1 changed files with 1 additions and 0 deletions
|
|
@ -307,6 +307,7 @@ func SessionAuthMiddleware(ctx *App, res http.ResponseWriter, req *http.Request)
|
||||||
// - identity provider redirection uri. eg: oauth2, openid, ...
|
// - identity provider redirection uri. eg: oauth2, openid, ...
|
||||||
templateBind, err := plugin.Callback(formData, idpParams, res)
|
templateBind, err := plugin.Callback(formData, idpParams, res)
|
||||||
if err == ErrAuthenticationFailed {
|
if err == ErrAuthenticationFailed {
|
||||||
|
Log.Warning("failed authentication - %s", err.Error())
|
||||||
http.Redirect(
|
http.Redirect(
|
||||||
res, req,
|
res, req,
|
||||||
req.URL.Path+"?action=redirect",
|
req.URL.Path+"?action=redirect",
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue