Skip to contents

This function verifies if a user is authenticated to interact with the Meetup API by checking the existence of token cache files in the specified directory.

Usage

meetup_auth_status(
  client_name = Sys.getenv("MEETUP_CLIENT_NAME", "meetupr"),
  silent = FALSE
)

has_auth(client_name = Sys.getenv("MEETUP_CLIENT_NAME", "meetupr"))

Arguments

client_name

A string representing the name of the client. By default, it is set to "meetupr" and retrieved from the MEETUP_CLIENT_NAME environment variable.

silent

A logical indicating whether to suppress output messages. Defaults to FALSE.

Value

logical. TRUE if a valid token is found, FALSE otherwise. If silent is FALSE, the function outputs status messages.

Details

The function checks the httr2 OAuth cache directory for encrypted token files (.rds.enc) associated with the specified client. Based on the results, it provides feedback about the authentication status. Multiple tokens in the cache directory trigger a warning, while a missing token or cache directory result in an error message.

Functions

  • has_auth(): Check if authenticated to Meetup API. Uses silent mode.

Examples

if (FALSE) { # \dontrun{
# Check authentication status with default client name
status <- meetup_auth_status()

# Check authentication status with a specific client name
status <- meetup_auth_status(client_name = "custom_client")

# Suppress output messages
status <- meetup_auth_status(silent = TRUE)
} # }