Fix, improve + test google provider initiation

This commit is contained in:
Thom Seddon
2019-04-23 18:48:18 +01:00
parent 3cc9cd13e1
commit fa61c84373
3 changed files with 44 additions and 21 deletions

View File

@ -18,24 +18,6 @@ type Google struct {
UserURL *url.URL
}
func (g *Google) Build() {
g.LoginURL = &url.URL{
Scheme: "https",
Host: "accounts.google.com",
Path: "/o/oauth2/auth",
}
g.TokenURL = &url.URL{
Scheme: "https",
Host: "www.googleapis.com",
Path: "/oauth2/v3/token",
}
g.UserURL = &url.URL{
Scheme: "https",
Host: "www.googleapis.com",
Path: "/oauth2/v2/userinfo",
}
}
func (g *Google) GetLoginURL(redirectUri, state string) string {
q := url.Values{}
q.Set("client_id", g.ClientId)