Fix the wrong regex for endpoint

This commit is contained in:
Parminder Singh 2018-03-10 13:31:55 +05:30
parent b2bb813020
commit 55552050c6
2 changed files with 4 additions and 3 deletions

View file

@ -101,9 +101,10 @@ func ServeTemplate(w http.ResponseWriter, templateHTML string, data map[string]s
// AuthFallback implements GET on /auth/{authType}/fallback/web?session={sessionID} // AuthFallback implements GET on /auth/{authType}/fallback/web?session={sessionID}
func AuthFallback( func AuthFallback(
w http.ResponseWriter, req *http.Request, authType string, sessionID string, w http.ResponseWriter, req *http.Request, authType string,
cfg config.Dendrite, cfg config.Dendrite,
) *util.JSONResponse { ) *util.JSONResponse {
sessionID := req.Form.Get("session")
ServeRecaptcha := func() { ServeRecaptcha := func() {
data := map[string]string{ data := map[string]string{
"MyUrl": req.URL.String(), "MyUrl": req.URL.String(),

View file

@ -174,10 +174,10 @@ func Setup(
}), }),
).Methods("GET", "POST", "OPTIONS") ).Methods("GET", "POST", "OPTIONS")
r0mux.Handle("/auth/{authType}/fallback/web?session={sessionID}", r0mux.Handle("/auth/{authType}/fallback/web",
common.MakeHTMLAPI("authfallback", func(w http.ResponseWriter, req *http.Request) *util.JSONResponse { common.MakeHTMLAPI("authfallback", func(w http.ResponseWriter, req *http.Request) *util.JSONResponse {
vars := mux.Vars(req) vars := mux.Vars(req)
return AuthFallback(w, req, vars["authType"], vars["sessionID"], cfg) return AuthFallback(w, req, vars["authType"], cfg)
}), }),
).Methods("GET", "POST", "OPTIONS") ).Methods("GET", "POST", "OPTIONS")