mirror of
https://github.com/drakkan/sftpgo.git
synced 2025-12-07 14:50:55 +03:00
oidc: allow login if the password method is disabled
isLoggedInWithOIDC returns false before login so we need to add a specific check Fixes #1879 Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
This commit is contained in:
@@ -902,7 +902,7 @@ func (s *httpdServer) handleWebClientDownloadZip(w http.ResponseWriter, r *http.
|
||||
connID := xid.New().String()
|
||||
protocol := getProtocolFromRequest(r)
|
||||
connectionID := fmt.Sprintf("%v_%v", protocol, connID)
|
||||
if err := checkHTTPClientUser(&user, r, connectionID, false); err != nil {
|
||||
if err := checkHTTPClientUser(&user, r, connectionID, false, false); err != nil {
|
||||
s.renderClientForbiddenPage(w, r, err)
|
||||
return
|
||||
}
|
||||
@@ -1192,7 +1192,7 @@ func (s *httpdServer) handleClientGetDirContents(w http.ResponseWriter, r *http.
|
||||
connID := xid.New().String()
|
||||
protocol := getProtocolFromRequest(r)
|
||||
connectionID := fmt.Sprintf("%s_%s", protocol, connID)
|
||||
if err := checkHTTPClientUser(&user, r, connectionID, false); err != nil {
|
||||
if err := checkHTTPClientUser(&user, r, connectionID, false, false); err != nil {
|
||||
sendAPIResponse(w, r, err, getI18NErrorString(err, util.I18nErrorDirList403), http.StatusForbidden)
|
||||
return
|
||||
}
|
||||
@@ -1281,7 +1281,7 @@ func (s *httpdServer) handleClientGetFiles(w http.ResponseWriter, r *http.Reques
|
||||
connID := xid.New().String()
|
||||
protocol := getProtocolFromRequest(r)
|
||||
connectionID := fmt.Sprintf("%v_%v", protocol, connID)
|
||||
if err := checkHTTPClientUser(&user, r, connectionID, false); err != nil {
|
||||
if err := checkHTTPClientUser(&user, r, connectionID, false, false); err != nil {
|
||||
s.renderClientForbiddenPage(w, r, err)
|
||||
return
|
||||
}
|
||||
@@ -1342,7 +1342,7 @@ func (s *httpdServer) handleClientEditFile(w http.ResponseWriter, r *http.Reques
|
||||
connID := xid.New().String()
|
||||
protocol := getProtocolFromRequest(r)
|
||||
connectionID := fmt.Sprintf("%v_%v", protocol, connID)
|
||||
if err := checkHTTPClientUser(&user, r, connectionID, false); err != nil {
|
||||
if err := checkHTTPClientUser(&user, r, connectionID, false, false); err != nil {
|
||||
s.renderClientForbiddenPage(w, r, err)
|
||||
return
|
||||
}
|
||||
@@ -1838,7 +1838,7 @@ func (s *httpdServer) handleClientGetPDF(w http.ResponseWriter, r *http.Request)
|
||||
connID := xid.New().String()
|
||||
protocol := getProtocolFromRequest(r)
|
||||
connectionID := fmt.Sprintf("%v_%v", protocol, connID)
|
||||
if err := checkHTTPClientUser(&user, r, connectionID, false); err != nil {
|
||||
if err := checkHTTPClientUser(&user, r, connectionID, false, false); err != nil {
|
||||
s.renderClientForbiddenPage(w, r, err)
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user