feat: add auto login for bad user sessions

This commit is contained in:
Sheen Capadngan
2025-06-03 02:47:09 +08:00
parent 96e9bc3b2f
commit f9ebb919e5
14 changed files with 935 additions and 879 deletions
+2 -2
View File
@@ -46,7 +46,7 @@ var initCmd = &cobra.Command{
}
if userCreds.LoginExpired {
util.PrintErrorMessageAndExit("Your login session has expired, please run [infisical login] and try again")
userCreds = util.EstablishUserLoginSession()
}
httpClient, err := util.GetRestyClientWithCustomHeaders()
@@ -81,7 +81,7 @@ var initCmd = &cobra.Command{
if tokenResponse.MfaEnabled {
i := 1
for i < 6 {
mfaVerifyCode := askForMFACode(tokenResponse.MfaMethod)
mfaVerifyCode := util.AskForMFACode(tokenResponse.MfaMethod)
httpClient, err := util.GetRestyClientWithCustomHeaders()
if err != nil {