datastorm-open / shinymanager

Simple and secure authentification mechanism for single shiny applications.
https://datastorm-open.github.io/shinymanager/
379 stars 79 forks source link

Remove case sensitivity from the username input? #162

Closed ferguskeatinge closed 11 months ago

ferguskeatinge commented 1 year ago

Is there an option to turn off case sensitivity on the username input? This would be a useful feature as many people dont expect case sensitivity on a username and can have trouble logging in.

Thanks.

ferguskeatinge commented 11 months ago

I found a solution to this problem (in case anyone else has the issue), you have to create your own check credentials function and at a tolower() function on the "user" value. I just modifed the existing check_credentials function as so:

check_creditials_new <- function(db, passphrase = NULL) { if (is.data.frame(db)) { function(user, password) { check_credentials_df(tolower(user), password, credentials_df = db) } } else { stop("'db' must be a data.frame or a path to a SQLite database", call. = FALSE) } }