1
0
mirror of https://github.com/pocketbase/pocketbase.git synced 2025-12-04 18:09:42 +02:00

added OAuth2 displayName and pkce options

This commit is contained in:
Gani Georgiev
2023-11-29 20:19:54 +02:00
parent 995733000f
commit b283ee2263
65 changed files with 421 additions and 226 deletions

View File

@@ -24,11 +24,13 @@ type Github struct {
// NewGithubProvider creates new Github provider instance with some defaults.
func NewGithubProvider() *Github {
return &Github{&baseProvider{
ctx: context.Background(),
scopes: []string{"read:user", "user:email"},
authUrl: github.Endpoint.AuthURL,
tokenUrl: github.Endpoint.TokenURL,
userApiUrl: "https://api.github.com/user",
ctx: context.Background(),
displayName: "GitHub",
pkce: true, // technically is not suppoted yet but it is safe as the PKCE params are just ignored
scopes: []string{"read:user", "user:email"},
authUrl: github.Endpoint.AuthURL,
tokenUrl: github.Endpoint.TokenURL,
userApiUrl: "https://api.github.com/user",
}}
}