From f1197b1873aeaef9170ce30e59cb4b0d95343f23 Mon Sep 17 00:00:00 2001 From: Luke Winslow Date: Mon, 18 Jan 2016 14:29:14 -0600 Subject: [PATCH 1/3] Simple solution to addressing #132 --- R/current_session.R | 7 +++++-- man/current_session.Rd | 3 ++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/R/current_session.R b/R/current_session.R index 23be870..672ccca 100644 --- a/R/current_session.R +++ b/R/current_session.R @@ -2,7 +2,8 @@ #' #'@description #'Returns the currently cached SB session. If there -#'is no authenticated session, returns NULL. +#'is no authenticated session, returns NULL. Emits a +#'warning if the session has expired. #' #'@author Luke Winslow #' @@ -12,6 +13,8 @@ #' #'@export current_session = function(){ - + if(session_expired(pkg.env$session)){ + warning('SB authentication expired, SB interaction may fail. Please re-authentication using authenticate_sb().') + } return(pkg.env$session) } \ No newline at end of file diff --git a/man/current_session.Rd b/man/current_session.Rd index 7762de0..11f4dbb 100644 --- a/man/current_session.Rd +++ b/man/current_session.Rd @@ -8,7 +8,8 @@ current_session() } \description{ Returns the currently cached SB session. If there -is no authenticated session, returns NULL. +is no authenticated session, returns NULL. Emits a +warning if the session has expired. } \examples{ From b990e187e76d81e9cccc7f16e787e009bce8a410 Mon Sep 17 00:00:00 2001 From: Luke Winslow Date: Mon, 18 Jan 2016 14:29:47 -0600 Subject: [PATCH 2/3] Er, I mean #158 --- DESCRIPTION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index 0eddc19..f79eefc 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: sbtools Title: USGS ScienceBase Tools Maintainer: Luke Winslow -Version: 0.14.3 +Version: 0.14.4 Authors@R: c(person("Luke", "Winslow", role = c("aut","cre"), email = "lwinslow@usgs.gov"), person("Scott", "Chamberlain", role = c("aut"), From b43684ce258831ad8e333a5556035ca1426dcfb6 Mon Sep 17 00:00:00 2001 From: Luke Winslow Date: Mon, 18 Jan 2016 15:10:30 -0600 Subject: [PATCH 3/3] fix wording --- R/current_session.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/current_session.R b/R/current_session.R index 672ccca..cc79272 100644 --- a/R/current_session.R +++ b/R/current_session.R @@ -14,7 +14,7 @@ #'@export current_session = function(){ if(session_expired(pkg.env$session)){ - warning('SB authentication expired, SB interaction may fail. Please re-authentication using authenticate_sb().') + warning('SB authentication expired, SB interaction may fail. Please re-authenticate using authenticate_sb().') } return(pkg.env$session) } \ No newline at end of file