Skip to content

Commit

Permalink
removed interactive() because useless
Browse files Browse the repository at this point in the history
  • Loading branch information
munoztd0 committed Dec 21, 2023
1 parent 8bd9aa5 commit 7400608
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 33 deletions.
38 changes: 6 additions & 32 deletions R/class-auth.R
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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)
Expand Down
1 change: 0 additions & 1 deletion R/class-email-password.R
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 7400608

Please sign in to comment.