#' get_token
#'
#' \code{get_token} provides a easy way for the user to POST the JWT authentication and receive a token to use the API
#'
#' @param \code{email}: \code{character string} with user's email.
#' @param \code{password}:\code{character string} with user's password.
#' @usage get_token(email=xxxx, password=xxx)
#' @return it returns the user's individual token
#' @examples
#' get_token(email=xxxx, password=xxxxx)
#' @import httr
#' @import rvest
#' @import purrr
#' @import jsonlite
#' @import tibble
#' @importFrom magrittr "%>%"
#' @export
get_token <- function(email, password){
get_jwt <- httr::POST("https://api.fogocruzado.org.br/api/v1/auth/login",
query = list(email = email, password = password))
token <- httr::content(get_jwt)$access_token
return(token)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.