diff --git a/app_upload/stitcher.go b/app_upload/stitcher.go index d1fa87b9..2e7b11dd 100755 --- a/app_upload/stitcher.go +++ b/app_upload/stitcher.go @@ -844,8 +844,8 @@ func main() { bucketName = os.Args[5] } - appname := "shuffle-ai" - appversion := "1.0.0" + appname := "email" + appversion := "1.3.0" err := deployConfigToBackend(appfolder, appname, appversion) if err != nil { log.Printf("[WARNING] Failed uploading config: %s", err) diff --git a/oauth2.go b/oauth2.go index 8c80c2a6..799de78c 100755 --- a/oauth2.go +++ b/oauth2.go @@ -4002,10 +4002,23 @@ func RunOauth2Request(ctx context.Context, user User, appAuth AppAuthenticationS // FIXME: Does this work with string? //https://stackoverflow.com/questions/43870554/microsoft-oauth2-authentication-not-returning-refresh-token parsedTime := strconv.FormatInt(int64(time.Now().Unix())+int64(oauthResp.ExpiresIn), 10) - appAuth.Fields = append(appAuth.Fields, AuthenticationStore{ - Key: "expiration", - Value: parsedTime, - }) + if oauthResp.ExpiresIn > 0 { + newauth := []AuthenticationStore{} + for _, item := range appAuth.Fields { + if item.Key == "expiration" { + continue + } + + newauth = append(newauth, item) + } + + newauth = append(newauth, AuthenticationStore{ + Key: "expiration", + Value: parsedTime, + }) + + appAuth.Fields = newauth + } if len(refreshUrl) > 0 && !refresh { log.Printf("[DEBUG] Appending Oauth2 Refresh URL %s", refreshUrl) diff --git a/shared.go b/shared.go index 72e754f6..8d31cadc 100755 --- a/shared.go +++ b/shared.go @@ -14565,7 +14565,8 @@ func handleKeyEncryption(data []byte, passphrase string) ([]byte, error) { } func HandleKeyDecryption(data []byte, passphrase string) ([]byte, error) { - log.Printf("[DEBUG] Passphrase: %s", passphrase) + //log.Printf("[DEBUG] Passphrase: %s", passphrase) + log.Printf("Decrypting key: %s", data) key, err := create32Hash(passphrase) if err != nil { log.Printf("[ERROR] Failed hashing in decrypt: %s", err) @@ -14600,7 +14601,8 @@ func HandleKeyDecryption(data []byte, passphrase string) ([]byte, error) { nonce, ciphertext := parsedData[:nonceSize], parsedData[nonceSize:] plaintext, err := gcm.Open(nil, nonce, ciphertext, nil) if err != nil { - log.Printf("[ERROR] Error reading decryptionkey: %s - nonce: %s, ciphertext: %s", err, nonce, ciphertext) + //log.Printf("[ERROR] Error reading decryptionkey: %s - nonce: %s, ciphertext: %s", err, nonce, ciphertext) + log.Printf("[ERROR] Error reading decryptionkey: %s - nonce: %s", err, nonce) return []byte{}, err } @@ -18791,7 +18793,7 @@ func PrepareWorkflowExecution(ctx context.Context, workflow Workflow, request *h } action.Parameters = append(action.Parameters, parameter) - log.Printf("[INFO] Adding parameter %s to subflow", parameter.Name) + //log.Printf("[INFO] Adding parameter %s to subflow", parameter.Name) } action.Parameters = append(action.Parameters, WorkflowAppActionParameter{