Skip to content

Instantly share code, notes, and snippets.

@shekodn
Last active September 20, 2019 14:29
Show Gist options
  • Save shekodn/780f4f71028e5d38940f69c078a3a8a3 to your computer and use it in GitHub Desktop.
Save shekodn/780f4f71028e5d38940f69c078a3a8a3 to your computer and use it in GitHub Desktop.
auth.go
func init() {
err := godotenv.Load()
if err != nil {
log.Fatal("Error loading .env file")
}
googleOauthConfig = &oauth2.Config{
RedirectURL: "http://localhost:" + os.Getenv("PORT") + "/callback",
ClientID: os.Getenv("GOOGLE_CLIENT_ID"),
ClientSecret: os.Getenv("GOOGLE_CLIENT_SECRET"),
Scopes: []string{"https://www.googleapis.com/auth/contacts.readonly"},
Endpoint: google.Endpoint,
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment