Skip to content

Commit 161ce28

Browse files
committed
Don't init .auth object until .onLoad
Creating the .auth object directly at the top-level means the code from gargle is snapshotted at build time. This is needed for r-lib/gargle#157, but is a good change even without that PR.
1 parent 9fdbfcc commit 161ce28

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Package: timecardassistant
22
Type: Package
33
Title: Assists In The Creating Of Timecards
4-
Version: 0.0.0.9550
4+
Version: 0.0.0.9551
55
Author: Ben Woodard
66
Maintainer: Ben Woodard <ben.woodard@searchdiscovery.com>
77
Description: Use this package to assist you in keeping track of your time.

R/aaa.R

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
.onLoad <- function(libname, pkgname) {
2+
.auth <<- gargle::init_AuthState(
3+
package = "gcal",
4+
auth_active = TRUE
5+
)
6+
}

R/gcalendr_auth.R

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,8 @@ calendar_app <- function() {
1010
)
1111
}
1212
options(gargle_oauth_email = TRUE)
13-
.auth <- gargle::init_AuthState(
14-
package = "gcal",
15-
auth_active = TRUE
16-
)
13+
# Initialized in .onLoad.
14+
.auth <- NULL
1715

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

0 commit comments

Comments
 (0)