include AuthOptions in ReauthFunc closure
diff --git a/openstack/client.go b/openstack/client.go
index 55c298c..6818d9d 100644
--- a/openstack/client.go
+++ b/openstack/client.go
@@ -58,7 +58,6 @@
if err != nil {
return nil, err
}
-
return client, nil
}
@@ -109,8 +108,9 @@
}
if options.AllowReauth {
- client.ReauthFunc = AuthenticateV2
- client.AuthOptions = options
+ client.ReauthFunc = func() error {
+ return AuthenticateV2(client, options)
+ }
}
client.TokenID = token.ID
client.EndpointLocator = func(opts gophercloud.EndpointOpts) (string, error) {
@@ -139,8 +139,9 @@
client.TokenID = token.ID
if options.AllowReauth {
- client.ReauthFunc = AuthenticateV3
- client.AuthOptions = options
+ client.ReauthFunc = func() error {
+ return AuthenticateV3(client, options)
+ }
}
client.EndpointLocator = func(opts gophercloud.EndpointOpts) (string, error) {
return V3EndpointURL(v3Client, opts)