Support oauth codes

This commit is contained in:
Ben Toogood
2020-04-01 15:36:22 +01:00
parent 1750fd8d10
commit ae15793fc3
3 changed files with 25 additions and 6 deletions

View File

@@ -12,7 +12,7 @@ type Provider interface {
// Options returns the options of a provider
Options() Options
// Endpoint for the provider
Endpoint() string
Endpoint(...EndpointOption) string
// Redirect url incase of UI
Redirect() string
}
@@ -26,3 +26,15 @@ type Grant struct {
// Scopes associated with grant
Scopes []string
}
type EndpointOptions struct {
Code string
}
type EndpointOption func(*EndpointOptions)
func WithCode(c string) EndpointOption {
return func(o *EndpointOptions) {
o.Code = c
}
}