Sign in the user by emailing them a link.
Other methods to pick up whether user signs in still apply. This is for added security measures.
firebase::Firebase -> firebase::FirebaseAuth -> FirebaseEmailLink
email_verificationEmail verification results
email_sentEmail send results
Inherited methods
firebase::Firebase$expose_app()firebase::FirebaseAuth$clear()firebase::FirebaseAuth$delete_user()firebase::FirebaseAuth$expose_auth()firebase::FirebaseAuth$get_access_token()firebase::FirebaseAuth$get_delete_user()firebase::FirebaseAuth$get_id_token()firebase::FirebaseAuth$get_sign_out()firebase::FirebaseAuth$get_signed_in()firebase::FirebaseAuth$get_signed_up()firebase::FirebaseAuth$is_signed_in()firebase::FirebaseAuth$print()firebase::FirebaseAuth$req_sign_in()firebase::FirebaseAuth$req_sign_out()firebase::FirebaseAuth$request_id_token()firebase::FirebaseAuth$set_language_code()firebase::FirebaseAuth$sign_out()
new()FirebaseEmailLink$new(
persistence = c("session", "local", "memory"),
config_path = "firebase.rds",
language_code = NULL,
session = shiny::getDefaultReactiveDomain()
)persistenceHow the auth should persit: none, the user has to sign in at every visit,
session will only persist in current tab, local persist even when window is closed.
config_pathPath to the configuration file as created by firebase_config.
language_codeSets the language to use for the UI.
Supported languages are listed here.
Set to browser to use the default browser language of the user.
sessionA valid shiny session.
config()urlThe link is handled in the web action widgets, this is the deep link in the continueUrl query parameter. Likely, your shiny application link.
...Any other parameter from the official documentation.
library(shiny)
library(firebase)
old <- options()
options(shiny.port = 3000)
ui <- fluidPage(
useFirebase(),
textInput("email", "Your email"),
actionButton("submit", "Submit")
)
server <- function(input, output){
f <- FirebaseEmailLink$
new()$
config(url = "http://127.0.0.1:3000")
observeEvent(input$submit, {
if(input$email == "")
return()
f$send(input$email)
})
observeEvent(f$get_email_sent(), {
sent <- f$get_email_sent()
if(sent$success)
showNotification("Email sent", type = "message")
})
observeEvent(f$get_email_verification(), {
print(f$get_email_verification())
})
}
if(interactive()){
shinyApp(ui, server)
}
options(old)
## ------------------------------------------------
## Method `FirebaseEmailLink$config`
## ------------------------------------------------
if (FALSE) {
f <- FirebaseEmailLink$
new()$ # create
config(url = "https://me.shinyapps.io/myApp/")
}
## ------------------------------------------------
## Method `FirebaseEmailLink$send_email`
## ------------------------------------------------
if (FALSE) {
f <- FirebaseEmailLink$
new()$ # create
config(url = "https://me.shinyapps.io/myApp/")$
send("user@email.com")
}