Fix: Moved comments

This commit is contained in:
Daniel Hougaard
2024-04-16 10:16:23 +02:00
parent 3a6ec3717b
commit a975fbd8a4

View File

@@ -74,17 +74,15 @@ func GetInfisicalToken(cmd *cobra.Command) (token *models.TokenDetails, err erro
return nil, err return nil, err
} }
if infisicalToken == "" { if infisicalToken == "" { // If no flag is passed, we first check for the universal auth access token env variable.
// If no flag is passed, we first check for the universal auth access token env variable.
infisicalToken = os.Getenv(INFISICAL_UNIVERSAL_AUTH_ACCESS_TOKEN_NAME) infisicalToken = os.Getenv(INFISICAL_UNIVERSAL_AUTH_ACCESS_TOKEN_NAME)
// If it's still empty after the first env check, we check for the service token env variable.
if infisicalToken == "" { if infisicalToken == "" { // If it's still empty after the first env check, we check for the service token env variable.
infisicalToken = os.Getenv(INFISICAL_TOKEN_NAME) infisicalToken = os.Getenv(INFISICAL_TOKEN_NAME)
} }
} }
// If it's empty, we return nothing at all. if infisicalToken == "" { // If it's empty, we return nothing at all.
if infisicalToken == "" {
return nil, nil return nil, nil
} }