@@ -14469,10 +14469,8 @@ func GetOpenIdUrl(request *http.Request, org Org, user User, mode string) (strin
1446914469 codeChallenge := verifier.CodeChallengeS256()
1447014470
1447114471 if !signIn {
14472- // Initialize slice if needed
1447314472 user.InitSSOInfos()
1447414473
14475- // Store SSO info per org (preserving existing Sub if present)
1447614474 existingSSOInfo, _ := user.GetSSOInfo(org.Id)
1447714475 user.SetSSOInfo(org.Id, SSOInfo{
1447814476 Sub: existingSSOInfo.Sub, // Keep existing Sub for this org
@@ -14482,7 +14480,7 @@ func GetOpenIdUrl(request *http.Request, org Org, user User, mode string) (strin
1448214480 })
1448314481
1448414482 ctx := context.Background()
14485- err := SetUser(ctx, &user, false )
14483+ err := SetUser(ctx, &user, true )
1448614484 if err != nil {
1448714485 return "", err
1448814486 }
@@ -22597,6 +22595,7 @@ func HandleOpenId(resp http.ResponseWriter, request *http.Request) {
2259722595 continue
2259822596 }
2259922597 ssoInfo, exists := fullUser.GetSSOInfo(org.Id)
22598+ log.Printf("[DEBUG] SSOInfo exists: %t", exists)
2260022599 if exists && ssoInfo.CodeVerifier != "" {
2260122600 verifierObj := &CodeVerifier{Value: ssoInfo.CodeVerifier}
2260222601 if verifierObj.CodeChallengeS256() == foundChallenge {
@@ -22766,6 +22765,8 @@ func HandleOpenId(resp http.ResponseWriter, request *http.Request) {
2276622765 }
2276722766 }
2276822767
22768+ // don't be confused. "AutoProvision" acts like "DisableAutoProvision"
22769+ // it's super stupid.
2276922770 if (!foundOrgInUser || !foundUserInOrg) && org.SSOConfig.AutoProvision {
2277022771 log.Printf("[WARNING] User %s (%s) is not in org %s (%s). Please contact the administrator - (1)", user.Username, user.Id, org.Name, org.Id)
2277122772 resp.WriteHeader(401)
@@ -24623,7 +24624,7 @@ func PrepareWorkflowExecution(ctx context.Context, workflow Workflow, request *h
2462324624 }
2462424625
2462524626 // Handles agentic run continues
24626- // This is if shuffler.io/agents => questions are answered
24627+ // This is if shuffler.io/agents => questions are answered
2462724628 if agentic {
2462824629 log.Printf("[INFO][%s] Should fix the decision by injecting the values and continuing to the next step! :3", oldExecution.ExecutionId)
2462924630
@@ -24656,7 +24657,7 @@ func PrepareWorkflowExecution(ctx context.Context, workflow Workflow, request *h
2465624657 findContinue = true
2465724658 }
2465824659
24659- if debug {
24660+ if debug {
2466024661 log.Printf("[DEBUG][%s] Found decision '%s' inside the agentic workflow to update. Exec arg: %#v", workflowExecution.ExecutionId, decisionId, execArg)
2466124662 }
2466224663
@@ -24726,7 +24727,7 @@ func PrepareWorkflowExecution(ctx context.Context, workflow Workflow, request *h
2472624727 continue
2472724728 }
2472824729
24729- if debug {
24730+ if debug {
2473024731 log.Printf("[DEBUG] Mapping field %d to value %s", fieldNumber, value)
2473124732 }
2473224733
@@ -24778,13 +24779,13 @@ func PrepareWorkflowExecution(ctx context.Context, workflow Workflow, request *h
2477824779 }
2477924780 }
2478024781
24781- // This is a weird if statement, due to it being used for
24782+ // This is a weird if statement, due to it being used for
2478224783 // multiple purposes around field change & decision id finding
2478324784
2478424785 // FIXME: Not sure if this is correct to catch bad decision IDs
2478524786 //if !fieldsChanged && cleanupFailures {
2478624787 if !fieldsChanged {
24787- //if cleanupFailures {
24788+ //if cleanupFailures {
2478824789 return workflowExecution, ExecInfo{}, fmt.Sprintf("Could not find fields for decision '%s'. Did you fill them in?", decisionId), errors.New(fmt.Sprintf("Could not find fields decision '%s'. Did you fill them in?", decisionId))
2478924790 }
2479024791
0 commit comments