mirror of
https://github.com/pocketbase/pocketbase.git
synced 2026-10-15 18:48:14 +02:00
added OAuth2 displayName and pkce options
This commit is contained in:
1 parent
995733000f
commit
b283ee2263
65 files changed
+421
-226
No files matched your search
@@ -620,6 +620,8 @@ type AuthProviderConfig struct {
|
||||
AuthUrl string `form:"authUrl" json:"authUrl"`
|
||||
TokenUrl string `form:"tokenUrl" json:"tokenUrl"`
|
||||
UserApiUrl string `form:"userApiUrl" json:"userApiUrl"`
|
||||
DisplayName string `form:"displayName" json:"displayName"`
|
||||
PKCE *bool `form:"pkce" json:"pkce"`
|
||||
}
|
||||
|
||||
// Validate makes `ProviderConfig` validatable by implementing [validation.Validatable] interface.
|
||||
@@ -659,6 +661,14 @@ func (c AuthProviderConfig) SetupProvider(provider auth.Provider) error {
|
||||
provider.SetTokenUrl(c.TokenUrl)
|
||||
}
|
||||
|
||||
if c.DisplayName != "" {
|
||||
provider.SetDisplayName(c.DisplayName)
|
||||
}
|
||||
|
||||
if c.PKCE != nil {
|
||||
provider.SetPKCE(*c.PKCE)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user