OTP support
This commit is contained in:
3
httpd.go
3
httpd.go
@@ -22,6 +22,7 @@ type jsonInputParams struct {
|
||||
Session int `json:"session"`
|
||||
User string `json:"user"`
|
||||
Pass string `json:"password"`
|
||||
OTP string `json:"otp"`
|
||||
}
|
||||
|
||||
type HttpServer struct {
|
||||
@@ -84,7 +85,7 @@ func (h *HttpServer) ajaxHandler(w http.ResponseWriter, r *http.Request) {
|
||||
err = h.ovpn.SetRemote(req.Params.Server, req.Params.Session)
|
||||
jsonStr = []byte("{\"status\": \"ok\"}")
|
||||
case "auth-user-pass":
|
||||
err = h.ovpn.AuthUserPass(req.Params.Session, req.Params.User, req.Params.Pass)
|
||||
err = h.ovpn.AuthUserPass(req.Params.Session, req.Params.User, req.Params.Pass, req.Params.OTP)
|
||||
jsonStr = []byte("{\"status\": \"ok\"}")
|
||||
case "get-sessions":
|
||||
jsonStr, err = json.Marshal(h.ovpn)
|
||||
|
||||
Reference in New Issue
Block a user