From edb9ff8a9e0719fc9d791e46fc9b86ed292cf60c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Samin?= Date: Tue, 17 May 2022 10:56:32 +0200 Subject: [PATCH] fix(api): new session with mfa log info (#6170) Signed-off-by: francois samin --- engine/api/auth.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/engine/api/auth.go b/engine/api/auth.go index 58148e8749..a4b054fbb2 100644 --- a/engine/api/auth.go +++ b/engine/api/auth.go @@ -13,6 +13,7 @@ import ( "github.com/ovh/cds/engine/api/user" "github.com/ovh/cds/engine/service" "github.com/ovh/cds/sdk" + cdslog "github.com/ovh/cds/sdk/log" ) func (api *API) getAuthDriversHandler() service.Handler { @@ -276,6 +277,7 @@ func (api *API) postAuthSigninHandler() service.Handler { var session *sdk.AuthSession if userInfo.MFA { trackSudo(ctx, w) + ctx = context.WithValue(ctx, cdslog.Sudo, true) session, err = authentication.NewSessionWithMFA(ctx, tx, api.Cache, consumer, sessionDuration) if err == nil { log.Info(ctx, "starting new session %s with MFA for consumer %s", session.ID, consumer.ID)