Code => State

This commit is contained in:
Ben Toogood 2020-04-01 17:11:46 +01:00
parent ae15793fc3
commit 365dfe9df5
2 changed files with 5 additions and 5 deletions

View File

@ -37,8 +37,8 @@ func (o *oauth) Endpoint(opts ...provider.EndpointOption) string {
params := make(url.Values)
params.Add("response_type", "code")
if len(options.Code) > 0 {
params.Add("code", options.Code)
if len(options.State) > 0 {
params.Add("state", options.State)
}
if clientID := o.opts.ClientID; len(clientID) > 0 {

View File

@ -28,13 +28,13 @@ type Grant struct {
}
type EndpointOptions struct {
Code string
State string
}
type EndpointOption func(*EndpointOptions)
func WithCode(c string) EndpointOption {
func WithState(c string) EndpointOption {
return func(o *EndpointOptions) {
o.Code = c
o.State = c
}
}