Skip to content

Commit

Permalink
fix: should pass back a ctx, never nil (#14)
Browse files Browse the repository at this point in the history
  • Loading branch information
bludot authored Mar 25, 2022
1 parent 9db6a8d commit 36f4f3b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions mfa/mfa.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,15 @@ func (m *Service) decodeJWT(jwt string) (*entities.JWTData, error) {
func (m *Service) getFlow(ctx context.Context, flow string, decodedJWT *entities.JWTData, challenge *string) (context.Context, flow.IFlow, error) {
requestedFlow := m.Flows[flow]
if requestedFlow == nil {
return nil, nil, errors.New("Flow not found")
return ctx, nil, errors.New("Flow not found")
}

if challenge == nil {
return nil, requestedFlow, nil
return ctx, requestedFlow, nil
}
newCtx, err := requestedFlow.Validate(ctx, *challenge, *decodedJWT)
if err != nil {
return nil, nil, err
return ctx, nil, err
}

return newCtx, requestedFlow, nil
Expand Down

0 comments on commit 36f4f3b

Please sign in to comment.