mirror of
https://github.com/warmbly/warmbly.git
synced 2026-08-19 16:01:16 +00:00
21 lines
428 B
Go
21 lines
428 B
Go
package config
|
|
|
|
import (
|
|
"os"
|
|
|
|
"golang.org/x/oauth2"
|
|
"golang.org/x/oauth2/google"
|
|
)
|
|
|
|
func GoogleOauth2Auth(baseURL string) *oauth2.Config {
|
|
return &oauth2.Config{
|
|
RedirectURL: baseURL + "/auth/google/callback",
|
|
ClientID: os.Getenv("GOOGLE_CLIENT_ID"),
|
|
ClientSecret: os.Getenv("GOOGLE_CLIENT_SECRET"),
|
|
Scopes: []string{
|
|
"https://www.googleapis.com/auth/userinfo.email",
|
|
},
|
|
Endpoint: google.Endpoint,
|
|
}
|
|
}
|