Giter VIP home page Giter VIP logo

Comments (4)

SVPA-PeterTat avatar SVPA-PeterTat commented on June 12, 2024 1

I was able to implement a solution which was simple enough... . Simply create a function to retrieve the latest user/password list within the Server of your shiny app. Execute this function inside the call module

Example:

server <- function(input, output, session) {

getUpdatedLoginList <- function() {
masterLogin <- dbGetQuery(pool, paste0("SELECT * FROM "TableABC" * "))

user_base <- tibble(
  user = c(masterLogin$user),
  password = c(masterLogin$password), 
  password_hash = sapply(c(masterLogin$password), sodium::password_store), 
  permissions = c(masterLogin$permissions), 
  name = c(masterLogin$name)
)

return(user_base)
}

credentials <- callModule(shinyauthr::login, "login",
data = getUpdatedLoginList(), #user_base,
user_col = user,
pwd_col = password_hash,
sodium_hashed = TRUE,
log_out = reactive(logout_init()))

}

from shinyauthr.

SNaveenMathew avatar SNaveenMathew commented on June 12, 2024

This did not solve my the issue! This may be because I added a 'Signup' tab next to the 'Login' tab that has shinyauthr::loginUI body. I forced a page refresh using JS:
shinyjs::js$refresh()

from shinyauthr.

stantond11 avatar stantond11 commented on June 12, 2024

Have you had a look at the Tychobra/Polished repo? its authentication for shiny and i would recommend it

from shinyauthr.

SNaveenMathew avatar SNaveenMathew commented on June 12, 2024

That's a great package @stantond11. For now I'm going to stick to shinyauthr + forced shinyjs::js$refresh() even though the signup-signin combo is overly complicated without a page refresh.

from shinyauthr.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.