I don't really know how to provide a reprex for this but I'm hoping someone can help:
I have this authenticating function that uses a simple shiny app to allow users to enter a username/password without printing it to the console (shamelessly stolen from https://github.com/r-dbi/RPostgres/issues/26#issuecomment-84040230)
authenticating_function <- function() {
authReqs <- list()
login = runGadget(loginApp,
viewer = dialogViewer("Enter username and password",
width = 400,
height = 400))
path = login$database_name
userID = login$username
password = login$password
authReqs[[1]] <- list(path=path, userID=userID, pswd=password)
readline("i am a mystery line that magically makes this function work. enter anything your heart desires")
return(authReqs)
}
However, none of the httr::POST() queries that use this function work when I comment out the readline() command (it was leftover from the previous method of authenticating which had the console issue). If the readline() is left there - works flawlessly, except that the user now has to type something into the console (not it's not even saved anywhere!). In either case, the output appears exactly the same.
output that is the same in both cases (as far as I can tell):
[[1]]
[[1]]$path
[1] "a_pathname"
[[1]]$userID
[1] "a_username"
[[1]]$pswd
[1] "a_password"
I suppose I left out my question....any ideas why and how to remove the readline() line?
thanks