forked from PaulC91/shinyauthr
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
25 changed files
with
2,668 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,5 @@ | ||
^.*\.Rproj$ | ||
^\.Rproj\.user$ | ||
^.*\.Rproj$ | ||
^\.Rproj\.user$ | ||
^_pkgdown\.yml$ | ||
^docs$ | ||
^pkgdown$ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -64,8 +64,6 @@ loginUI <- function(id, title = "Please log in", user_title = "User Name", pass_ | |
#' a successful login or not. Second element \code{info} will be the data frame provided | ||
#' to the function, filtered to the row matching the succesfully logged in username. | ||
#' When \code{user_auth} is FALSE \code{info} is NULL. | ||
#' | ||
#' @author Paul Campbell, \email{[email protected]} | ||
#' | ||
#' @importFrom rlang := | ||
#' | ||
|
@@ -104,7 +102,7 @@ login <- function(input, output, session, data, user_col, pwd_col, sodium_hashed | |
# ensure all text columns are character class | ||
data <- dplyr::mutate_if(data, is.factor, as.character) | ||
# if password column hasn't been hashed with sodium, do it for them | ||
if (!sodium_hashed) data <- dplyr::mutate(data, !!pwds := sapply(!!pwds, sodium::password_store)) | ||
# if (!sodium_hashed) data <- dplyr::mutate(data, !!pwds := sapply(!!pwds, sodium::password_store)) | ||
|
||
shiny::observeEvent(input$button, { | ||
|
||
|
@@ -114,20 +112,14 @@ login <- function(input, output, session, data, user_col, pwd_col, sodium_hashed | |
if (length(row_username)) { | ||
row_password <- dplyr::filter(data,dplyr::row_number() == row_username) | ||
row_password <- dplyr::pull(row_password, !!pwds) | ||
password_match <- sodium::password_verify(row_password, input$password) | ||
if (sodium_hashed) { | ||
password_match <- sodium::password_verify(row_password, input$password) | ||
} else { | ||
password_match <- identical(row_password, input$password) | ||
} | ||
} else { | ||
password_match <- FALSE | ||
} | ||
|
||
# if (hashed) { | ||
# # check for match of hashed input password to hashed password column in data | ||
# row_password <- which(dplyr::pull(data, !! pwds) == digest::digest(input$password, algo = algo)) | ||
# | ||
# } else { | ||
# # if passwords are not hashed, hash them with md5 and do the same with the input password | ||
# data <- dplyr::mutate(data, !! pwds := sapply(!! pwds, digest::digest)) | ||
# row_password <- which(dplyr::pull(data, !! pwds) == digest::digest(input$password)) | ||
# } | ||
|
||
# if user name row and password name row are same, credentials are valid | ||
if (length(row_username) == 1 && password_match) { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,8 +12,6 @@ | |
#' | ||
#' @return Shiny UI action button | ||
#' | ||
#' @author Paul Campbell, \email{[email protected]} | ||
#' | ||
#' @export | ||
logoutUI <- function(id, label = "Log out", icon = NULL, class = "btn-danger", style = "color: white;") { | ||
ns <- shiny::NS(id) | ||
|
@@ -38,8 +36,6 @@ logoutUI <- function(id, label = "Log out", icon = NULL, class = "btn-danger", s | |
#' @return The reactive output of this module should be supplied as the \code{log_out} argument to the | ||
#' \link{login} module to trigger the logout process | ||
#' | ||
#' @author Paul Campbell, \email{[email protected]} | ||
#' | ||
#' @examples | ||
#' \dontrun{ | ||
#' logout_init <- shiny::callModule(logout, "logout", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
destination: docs | ||
url: | ||
|
||
authors: | ||
Paul Campbell: | ||
href: https://github.com/paulc91 | ||
|
||
template: | ||
params: | ||
bootswatch: simplex | ||
|
||
navbar: | ||
left: | ||
- icon: fa-home fa-lg | ||
href: index.html | ||
- text: Reference | ||
href: reference/index.html | ||
- text: Changelog | ||
href: news/index.html | ||
right: | ||
- icon: fa-github fa-lg | ||
href: https://github.com/paulc91/shinyauthr | ||
|
||
reference: | ||
- title: "Login" | ||
desc: > | ||
Login modules | ||
contents: | ||
- login | ||
- loginUI | ||
- title: "Logout" | ||
desc: > | ||
Logout modules | ||
contents: | ||
- logout | ||
- logoutUI |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.