| FirebaseEmailLink | R Documentation |
Sign in the user by emailing them a link.
An object of class FirebaseEmailLink.
firebase::Firebase -> firebase::FirebaseAuth -> FirebaseEmailLink
email_verificationEmail verification results
email_sentEmail send results
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.
Initialiases Firebase Email Link
Initialises the Firebase application client-side.
config()FirebaseEmailLink$config(url, ...)
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.
Configure
\dontrun{
f <- FirebaseEmailLink$
new()$ # create
config(url = "https://me.shinyapps.io/myApp/")
}
send_email()FirebaseEmailLink$send_email(email)
emailEmail to send verification to.
Send email verification link.
self
\dontrun{
f <- FirebaseEmailLink$
new()$ # create
config(url = "https://me.shinyapps.io/myApp/")$
send("user@email.com")
}
get_email_sent()FirebaseEmailLink$get_email_sent()
Get whether email verification was correctly sent.
A list of length 2 containing success a boolean
indicating wherther sending the email was successful and response
containing the email used to sign in or the error if sending failed.
get_email_verification()FirebaseEmailLink$get_email_verification()
Get whether user is signing in from email verification.
A list of length 2 containing success a boolean
indicating wherther signing in from the verification link was successful and response
containing the result of the sign in or the error if signing in failed.
clone()The objects of this class are cloneable with this method.
FirebaseEmailLink$clone(deep = FALSE)
deepWhether to make a deep clone.
Other methods to pick up whether user signs in still apply. This is for added security measures.
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`
## ------------------------------------------------
## Not run:
f <- FirebaseEmailLink$
new()$ # create
config(url = "https://me.shinyapps.io/myApp/")
## End(Not run)
## ------------------------------------------------
## Method `FirebaseEmailLink$send_email`
## ------------------------------------------------
## Not run:
f <- FirebaseEmailLink$
new()$ # create
config(url = "https://me.shinyapps.io/myApp/")$
send("user@email.com")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.