datastorm-open / shinymanager

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

`shinymanager::secure_app()` causing warnings in `R CMD check` #101

Closed mrkaye97 closed 3 years ago

mrkaye97 commented 3 years ago

I can't reprex this because I'd need the whole package infrastructure, but the TL;DR is that I'm running a {golem} with a UI defined like this:

app_ui <- shinymanager::secure_app(function(request) {
  tagList(
    # Leave this function for adding external resources
    golem_add_external_resources(),
    # List the first level UI elements here
    navbarPage(
      'foo',
      tabPanel('bar',
               mod_baz_ui("qux"))   
    )
  )
})

and then running devtools::check() gives me these warnings:

checking R code for possible problems ... NOTE
  Warning: <anonymous>: ... may be used in an incorrect context: ‘get_args(..., fun = pwd_ui)’

  Warning: <anonymous>: ... may be used in an incorrect context: ‘get_args(..., fun = auth_ui)’

  Warning: <anonymous>: ... may be used in an incorrect context: ‘list(...)’

  app_ui: ... may be used in an incorrect context: ‘get_args(..., fun =
    pwd_ui)’
  app_ui: ... may be used in an incorrect context: ‘get_args(..., fun =
    auth_ui)’
  app_ui: ... may be used in an incorrect context: ‘list(...)’

which seems to be coming from here: https://github.com/datastorm-open/shinymanager/blob/d22bed0e1c4de313c37197f2fbd1a351d79745a1/R/secure-app.R#L60

and here: https://github.com/datastorm-open/shinymanager/blob/d22bed0e1c4de313c37197f2fbd1a351d79745a1/R/secure-app.R#L144

and here: https://github.com/datastorm-open/shinymanager/blob/d22bed0e1c4de313c37197f2fbd1a351d79745a1/R/secure-app.R#L146

Has anyone had this issue before? AFAICT, there's nothing I can do to silence these warnings on my end

pvictor commented 3 years ago

I wasn't able to reproduce this issue. Running R CMD Check on https://github.com/ColinFay/golemexamples/tree/master/golemshinymanager doesn't raise that NOTE..

mrkaye97 commented 3 years ago

Thanks @pvictor! It passed when using that approach as opposed to wrapping the UI in shinymanager::secure_app() in app_ui.R.

Closing this