FirebaseEmailLink: Email Link

Description Super class Active bindings Methods Note Examples

Description

Sign in the user by emailing them a link.

Super class

firebase::Firebase -> FirebaseEmailLink

Active bindings

email_verification

Email verification results

email_sent

Email send results

Methods

Public methods

Inherited methods

Method config()

Usage
FirebaseEmailLink$config(url, ...)
Arguments
url

The 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.

Details

Configure

Examples
\dontrun{
f <- FirebaseEmailLink$
 new()$ # create
 config(url = "https://me.shinyapps.io/myApp/")
}

Method send()

Usage
FirebaseEmailLink$send(email)
Arguments
email

Email to send verification to.

Details

Send email verification link.

Returns

self

Examples
\dontrun{
f <- FirebaseEmailLink$
 new()$ # create
 config(url = "https://me.shinyapps.io/myApp/")$
 send("user@email.com")
}


Method get_email_sent()

Usage
FirebaseEmailLink$get_email_sent()
Details

Get whether email verification was correctly sent.

Returns

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.


Method get_email_verification()

Usage
FirebaseEmailLink$get_email_verification()
Details

Get whether user is signing in from email verification.

Returns

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.


Method clone()

The objects of this class are cloneable with this method.

Usage
FirebaseEmailLink$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.

Note

Other methods to pick up whether user signs in still apply. This is for added security measures.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
library(shiny)
library(firebase)

options(shiny.port = 3000) 

ui <- fluidPage(
  useFirebase(),
  textInput("email", "Your email"),
  actionButton("submit", "Submit")
)

server <- function(input, output){

  f <- FireblazeEmailLink$
    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())
  })

}

## Not run: shinyApp(ui, server)


## ------------------------------------------------
## Method `FirebaseEmailLink$config`
## ------------------------------------------------

## Not run: 
f <- FirebaseEmailLink$
 new()$ # create
 config(url = "https://me.shinyapps.io/myApp/")

## End(Not run)

## ------------------------------------------------
## Method `FirebaseEmailLink$send`
## ------------------------------------------------

## Not run: 
f <- FirebaseEmailLink$
 new()$ # create
 config(url = "https://me.shinyapps.io/myApp/")$
 send("user@email.com")

## End(Not run)

firebase documentation built on March 31, 2020, 5:17 p.m.