Implement /register/available API (#291)

Signed-off-by: MTRNord <mtrnord1@gmail.com>
This commit is contained in:
Marcel 2017-10-09 16:24:38 +02:00 committed by Erik Johnston
parent 619fec6113
commit 13107c6b2b
3 changed files with 79 additions and 15 deletions

View file

@ -131,6 +131,10 @@ func Setup(
return writers.LegacyRegister(req, accountDB, deviceDB, &cfg)
})).Methods("POST", "OPTIONS")
r0mux.Handle("/register/available", common.MakeExternalAPI("registerAvailable", func(req *http.Request) util.JSONResponse {
return writers.RegisterAvailable(req, accountDB)
})).Methods("GET")
r0mux.Handle("/directory/room/{roomAlias}",
common.MakeAuthAPI("directory_room", deviceDB, func(req *http.Request, device *authtypes.Device) util.JSONResponse {
vars := mux.Vars(req)