Skip to content
Snippets Groups Projects
Verified Commit 18b1ba13 authored by Gabriel Zachmann's avatar Gabriel Zachmann
Browse files

return bad request response if token revocation call does not contain token

parent 7f94f3c4
No related branches found
No related tags found
No related merge requests found
......@@ -35,10 +35,18 @@ func HandleRevoke(ctx *fiber.Ctx) error {
if err := ctx.BodyParser(&req); err != nil {
return model.ErrorToBadRequestErrorResponse(err).Send(ctx)
}
rlog.Trace("Parsed mytoken request")
rlog.WithField("parsed request", fmt.Sprintf("%+v", req)).WithField(
"body", string(ctx.Body()),
).Trace("Parsed revocation request")
clearCookie := false
if req.Token == "" {
req.Token = ctx.Cookies("mytoken")
if req.Token == "" {
return model.Response{
Status: fiber.StatusBadRequest,
Response: model.BadRequestError("no token given"),
}.Send(ctx)
}
if req.MOMID == "" {
clearCookie = true
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment