Don't mutate the authorization endpoint.

Flow should be reusable, Options object should not be
mutated by the calls performed on the flow.
This commit is contained in:
Burcu Dogan 2014-11-12 10:02:14 +11:00
parent 0b8fcbadce
commit 2d3ce25e9a

View File

@ -145,7 +145,7 @@ func New(options ...Option) (*Flow, error) {
// access token. If set to "force" the user will always be prompted, // access token. If set to "force" the user will always be prompted,
// and the code can be exchanged for a refresh token. // and the code can be exchanged for a refresh token.
func (f *Flow) AuthCodeURL(state, accessType, prompt string) string { func (f *Flow) AuthCodeURL(state, accessType, prompt string) string {
u := f.opts.AuthURL u := *f.opts.AuthURL
v := url.Values{ v := url.Values{
"response_type": {"code"}, "response_type": {"code"},
"client_id": {f.opts.ClientID}, "client_id": {f.opts.ClientID},