Skip to content

Commit

Permalink
fix(api): new session with mfa log info (#6170)
Browse files Browse the repository at this point in the history
Signed-off-by: francois  samin <francois.samin@corp.ovh.com>
  • Loading branch information
fsamin committed May 17, 2022
1 parent 9aa776a commit edb9ff8
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions engine/api/auth.go
Expand Up @@ -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 {
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit edb9ff8

Please sign in to comment.