mirror of
https://github.com/drakkan/sftpgo.git
synced 2025-12-07 23:00:55 +03:00
allow to require two-factor auth for users
Fixes #721 Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
This commit is contained in:
@@ -396,6 +396,11 @@ func checkPublicShare(w http.ResponseWriter, r *http.Request, shareShope datapro
|
||||
renderError(err, "", getRespStatus(err))
|
||||
return share, nil, err
|
||||
}
|
||||
if user.MustSetSecondFactorForProtocol(common.ProtocolHTTP) {
|
||||
err := util.NewMethodDisabledError("two-factor authentication requirements not met")
|
||||
renderError(err, "", getRespStatus(err))
|
||||
return share, nil, err
|
||||
}
|
||||
connID := xid.New().String()
|
||||
connection := &Connection{
|
||||
BaseConnection: common.NewBaseConnection(connID, common.ProtocolHTTPShare, util.GetHTTPLocalAddress(r),
|
||||
|
||||
Reference in New Issue
Block a user