session_renew: Checks current session and re-authenticates if necessary

View source: R/session_renew.R

session_renewR Documentation

Checks current session and re-authenticates if necessary

Description

Checks the state of your Sciencebase session, re-authenticates if the session is expired, and simply renews if the session is active.

Usage

session_renew(password, ..., username, session = current_session())

Arguments

password

The password to use, if needed, to renew the session.

...

Any additional parameters are currently ignored.

username

Optional. Used only to confirm that the current username is what you expect; if you want to switch usernames, use authenticate_sb() instead of this function.

session

SB session object from authenticate_sb. Default is the current session.

Value

Returns the session object.

Examples

## Not run: 
# an empty call is sufficient if the session is current, 
# but will break if haven't been logged in before
session_renew()

# include a password if session may be expired
session_renew('newpass')

# optionally confirm the value of the current username
session_renew(username='olduser@usgs.gov', 'newpass')

## End(Not run)

sbtools documentation built on May 1, 2023, 1:07 a.m.