Code => State
This commit is contained in:
parent
ae15793fc3
commit
365dfe9df5
@ -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 {
|
||||
|
@ -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
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user