Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't init .auth object until .onLoad #147

Merged
merged 1 commit into from
Nov 12, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: gmailr
Title: Access the 'Gmail' 'RESTful' API
Version: 1.0.0.9000
Version: 1.0.0.9001
Author: Jim Hester
Maintainer: Jim Hester <james.f.hester@gmail.com>
Description: An interface to the 'Gmail' 'RESTful' API. Allows
Expand Down
8 changes: 8 additions & 0 deletions R/aaa.R
Original file line number Diff line number Diff line change
@@ -1 +1,9 @@
the <- new.env(parent = emptyenv())

.onLoad <- function(libname, pkgname) {

.auth <<- gargle::init_AuthState(
package = "gmailr",
auth_active = TRUE
)
}
7 changes: 3 additions & 4 deletions R/gm-auth.R
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
# This file is the interface between gmailr and the
# auth functionality in gargle.
.auth <- gargle::init_AuthState(
package = "gmailr",
auth_active = TRUE
)

# Initialization happens in .onLoad
.auth <- NULL

# The roxygen comments for these functions are mostly generated from data
# in this list and template text maintained in gargle.
Expand Down