From 8bd9aa5c315ae754ff7b675f383566589b3f933c Mon Sep 17 00:00:00 2001 From: munoztd0 Date: Thu, 21 Dec 2023 13:27:31 +0100 Subject: [PATCH 1/2] fix: :pencil2: fixed interactive typo --- R/class-auth.R | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/R/class-auth.R b/R/class-auth.R index 467d361..efc59f7 100644 --- a/R/class-auth.R +++ b/R/class-auth.R @@ -274,7 +274,7 @@ FirebaseAuth <- R6::R6Class( if(inherits(signature, "error")){ cli_alert_danger("Invalid signature") - if(interactive){ + if(interactive()){ CHOICE <- menu(c("Yes", "No"), title="Do you still want to continue ?") if (CHOICE != TRUE){ return(FALSE) @@ -291,7 +291,7 @@ FirebaseAuth <- R6::R6Class( if(as.numeric(signature$exp) < now){ cli_alert_danger("Signature expiry is in the past") - if(interactive){ + if(interactive()){ CHOICE <- menu(c("Yes", "No"), title="Do you still want to continue ?") if (CHOICE != TRUE){ return(FALSE) @@ -305,7 +305,7 @@ FirebaseAuth <- R6::R6Class( if(as.numeric(signature$iat) > now){ cli_alert_danger("Signature expiry is in the future") - if(interactive){ + if(interactive()){ CHOICE <- menu(c("Yes", "No"), title="Do you still want to continue ?") if (CHOICE != TRUE){ return(FALSE) @@ -319,7 +319,7 @@ FirebaseAuth <- R6::R6Class( if(signature$aud != super$get_project_id()){ cli_alert_danger("Signature audience is not the project id") - if(interactive){ + if(interactive()){ CHOICE <- menu(c("Yes", "No"), title="Do you still want to continue ?") if (CHOICE != TRUE){ return(FALSE) @@ -338,7 +338,7 @@ FirebaseAuth <- R6::R6Class( if(signature$iss != iss){ cli_alert_danger("Signature incorrect issuer") - if(interactive){ + if(interactive()){ CHOICE <- menu(c("Yes", "No"), title="Do you still want to continue ?") if (CHOICE != TRUE){ return(FALSE) @@ -352,7 +352,7 @@ FirebaseAuth <- R6::R6Class( if(signature$sub == ""){ cli_alert_danger("Signature subject is invalid") - if(interactive){ + if(interactive()){ CHOICE <- menu(c("Yes", "No"), title="Do you still want to continue ?") if (CHOICE != TRUE){ return(FALSE) @@ -366,7 +366,7 @@ FirebaseAuth <- R6::R6Class( if(signature$auth_time > now){ cli_alert_danger("Signature auth time is in the future.") - if(interactive){ + if(interactive()){ CHOICE <- menu(c("Yes", "No"), title="Do you still want to continue ?") if (CHOICE != TRUE){ return(FALSE) From 7400608643dcc991a3d6442f3b4ab080ef1cc5c5 Mon Sep 17 00:00:00 2001 From: munztd0 Date: Thu, 21 Dec 2023 14:16:09 +0100 Subject: [PATCH 2/2] removed interactive() because useless --- R/class-auth.R | 38 ++++++-------------------------------- R/class-email-password.R | 1 - 2 files changed, 6 insertions(+), 33 deletions(-) diff --git a/R/class-auth.R b/R/class-auth.R index efc59f7..15a3b37 100644 --- a/R/class-auth.R +++ b/R/class-auth.R @@ -274,62 +274,48 @@ FirebaseAuth <- R6::R6Class( if(inherits(signature, "error")){ cli_alert_danger("Invalid signature") - if(interactive()){ CHOICE <- menu(c("Yes", "No"), title="Do you still want to continue ?") if (CHOICE != TRUE){ return(FALSE) } else { print("Invalid signature but continuing...") } - } else { - return(FALSE) - } + } - } now <- as.numeric(Sys.time() + private$.grace_period) if(as.numeric(signature$exp) < now){ cli_alert_danger("Signature expiry is in the past") - if(interactive()){ CHOICE <- menu(c("Yes", "No"), title="Do you still want to continue ?") if (CHOICE != TRUE){ return(FALSE) } else { print("Signature expiry is in the past but continuing...") } - } else { - return(FALSE) - } - } + } + if(as.numeric(signature$iat) > now){ cli_alert_danger("Signature expiry is in the future") - if(interactive()){ CHOICE <- menu(c("Yes", "No"), title="Do you still want to continue ?") if (CHOICE != TRUE){ return(FALSE) } else { print("Signature expiry is in the future but continuing...") } - } else { - return(FALSE) - } } if(signature$aud != super$get_project_id()){ cli_alert_danger("Signature audience is not the project id") - if(interactive()){ CHOICE <- menu(c("Yes", "No"), title="Do you still want to continue ?") if (CHOICE != TRUE){ return(FALSE) } else { print("Signature audience is not the project id but continuing...") } - } else { - return(FALSE) - } - } + } + iss <- sprintf( "https://securetoken.google.com/%s", @@ -338,44 +324,32 @@ FirebaseAuth <- R6::R6Class( if(signature$iss != iss){ cli_alert_danger("Signature incorrect issuer") - if(interactive()){ CHOICE <- menu(c("Yes", "No"), title="Do you still want to continue ?") if (CHOICE != TRUE){ return(FALSE) } else { print("Signature incorrect issuer but continuing...") } - } else { - return(FALSE) - } - } + } if(signature$sub == ""){ cli_alert_danger("Signature subject is invalid") - if(interactive()){ CHOICE <- menu(c("Yes", "No"), title="Do you still want to continue ?") if (CHOICE != TRUE){ return(FALSE) } else { print("Signature subject is invalid but continuing...") } - } else { - return(FALSE) - } } if(signature$auth_time > now){ cli_alert_danger("Signature auth time is in the future.") - if(interactive()){ CHOICE <- menu(c("Yes", "No"), title="Do you still want to continue ?") if (CHOICE != TRUE){ return(FALSE) } else { print("Signature auth time is in the future but continuing...") } - } else { - return(FALSE) - } } return(TRUE) diff --git a/R/class-email-password.R b/R/class-email-password.R index bba1b0c..9567245 100644 --- a/R/class-email-password.R +++ b/R/class-email-password.R @@ -200,7 +200,6 @@ FirebaseEmailPassword <- R6::R6Class( super$get_input("set_password") }, #' @details Re-authenticate the user. -#' #' Some security-sensitive actions—such as deleting an account, setting a #' primary email address, and changing a password—require that the user has #' recently signed in. If you perform one of these actions, and the user signed