-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy pathgist_auth.Rd
42 lines (40 loc) · 1.38 KB
/
gist_auth.Rd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/gist_auth.R
\name{gist_auth}
\alias{gist_auth}
\title{Authorize with GitHub.}
\usage{
gist_auth(app = gistr_app, reauth = FALSE)
}
\arguments{
\item{app}{An \code{\link[httr:oauth_app]{httr::oauth_app()}} for GitHub. The default uses an
application \code{gistr_oauth} created by Scott Chamberlain.}
\item{reauth}{(logical) Force re-authorization?}
}
\value{
a named list, with a single slot for \code{Authorization}, with a single
element with the token - this is the expected format needed when passed
down to the http request
}
\description{
This function is run automatically to allow gistr to access your GitHub
account.
}
\details{
There are two ways to authorise gistr to work with your GitHub account:
\itemize{
\item Generate a personal access token with the gist scope selected, and store it
with \code{gitcreds::gitcreds_set()}. Alternatively you can set it as the
\code{GITHUB_PAT} environment variable per session using \code{Sys.setenv()} or across
sessions by adding it to your \code{.Renviron} file or similar. See
https://help.github.com/articles/creating-an-access-token-for-command-line-use
for help or use \code{usethis::create_github_token()}.
\item Interactively log in into your GitHub account and authorise with OAuth.
}
Using \code{gitcreds::gitcreds_set()} is recommended.
}
\examples{
\dontrun{
gist_auth()
}
}