Add whoami endpoint support (#434)

* Add whoami endpoint support

Signed-off-by: Anant Prakash <anantprakashjsr@gmail.com>

* Trim code, update against merged changes
This commit is contained in:
Anant Prakash 2018-08-04 15:02:02 +05:30 committed by GitHub
parent 1176c1d574
commit dc89e04e7d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 40 additions and 0 deletions

View file

@ -181,6 +181,12 @@ func Setup(
}),
).Methods(http.MethodPut, http.MethodOptions)
r0mux.Handle("/account/whoami",
common.MakeAuthAPI("whoami", authData, func(req *http.Request, device *authtypes.Device) util.JSONResponse {
return Whoami(req, device)
}),
).Methods(http.MethodGet, http.MethodOptions)
// Stub endpoints required by Riot
r0mux.Handle("/login",