session response 200 on login & logout.

This commit is contained in:
Miroslav Šedivý 2021-01-29 23:03:35 +01:00
parent 57ed35552f
commit dabda571d4

View File

@ -46,7 +46,11 @@ func (api *ApiManagerCtx) Login(w http.ResponseWriter, r *http.Request) {
HttpOnly: true,
})
utils.HttpSuccess(w)
utils.HttpSuccess(w, SessionWhoamiPayload{
ID: session.ID(),
Profile: session.GetProfile(),
State: session.GetState(),
})
}
func (api *ApiManagerCtx) Logout(w http.ResponseWriter, r *http.Request) {
@ -66,7 +70,7 @@ func (api *ApiManagerCtx) Logout(w http.ResponseWriter, r *http.Request) {
HttpOnly: true,
})
utils.HttpSuccess(w)
utils.HttpSuccess(w, true)
}
func (api *ApiManagerCtx) Whoami(w http.ResponseWriter, r *http.Request) {