Skip to content

Commit edb9ff8

Browse files
authored
fix(api): new session with mfa log info (#6170)
Signed-off-by: francois samin <[email protected]>
1 parent 9aa776a commit edb9ff8

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

engine/api/auth.go

+2
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import (
1313
"github.com/ovh/cds/engine/api/user"
1414
"github.com/ovh/cds/engine/service"
1515
"github.com/ovh/cds/sdk"
16+
cdslog "github.com/ovh/cds/sdk/log"
1617
)
1718

1819
func (api *API) getAuthDriversHandler() service.Handler {
@@ -276,6 +277,7 @@ func (api *API) postAuthSigninHandler() service.Handler {
276277
var session *sdk.AuthSession
277278
if userInfo.MFA {
278279
trackSudo(ctx, w)
280+
ctx = context.WithValue(ctx, cdslog.Sudo, true)
279281
session, err = authentication.NewSessionWithMFA(ctx, tx, api.Cache, consumer, sessionDuration)
280282
if err == nil {
281283
log.Info(ctx, "starting new session %s with MFA for consumer %s", session.ID, consumer.ID)

0 commit comments

Comments
 (0)