feat: added region flag for eu in cli

This commit is contained in:
=
2025-01-18 17:05:29 +05:30
parent 3ba396f7fa
commit d627ecf05d
3 changed files with 23 additions and 7 deletions
+5 -1
View File
@@ -315,7 +315,11 @@ var loginCmd = &cobra.Command{
credential, err := authStrategies[strategy](cmd, infisicalClient)
if err != nil {
util.HandleError(fmt.Errorf("unable to authenticate with %s [err=%v]", formatAuthMethod(loginMethod), err))
euErrorMessage := ""
if strings.HasPrefix(config.INFISICAL_URL, util.INFISICAL_DEFAULT_US_URL) {
euErrorMessage = "\nIf you are using the Infisical Cloud Europe Region, please switch to it by using the \"--region eu\" flag."
}
util.HandleError(fmt.Errorf("unable to authenticate with %s [err=%v].%s", formatAuthMethod(loginMethod), err, euErrorMessage))
}
if plainOutput {