Skip to content

Commit a456d9b

Browse files
authored
Merge pull request #87 from chrroberts-pure/fix-logout-bug
Fix logouts and refreshes
2 parents c1cfd8d + d6ec7d5 commit a456d9b

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

internal/rest-client/flashblade_client.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,16 +108,19 @@ func (fb *FBClient) Close() *FBClient {
108108
if fb.XAuthToken == "" {
109109
return fb
110110
}
111+
fb.RestClient.SetBaseURL("https://" + fb.EndPoint + "/api")
111112
_, err := fb.RestClient.R().
112113
SetHeader("x-auth-token", fb.XAuthToken).
113114
Post("/logout")
114115
if err != nil {
115116
fb.Error = err
116117
}
118+
fb.RestClient.SetBaseURL("https://" + fb.EndPoint + "/api/" + fb.ApiVersion)
117119
return fb
118120
}
119121

120122
func (fb *FBClient) RefreshSession() *FBClient {
123+
fb.RestClient.SetBaseURL("https://" + fb.EndPoint + "/api")
121124
res, err := fb.RestClient.R().
122125
SetHeader("api-token", fb.ApiToken).
123126
Post("/login")
@@ -127,5 +130,6 @@ func (fb *FBClient) RefreshSession() *FBClient {
127130
}
128131
fb.XAuthToken = res.Header().Get("x-auth-token")
129132
fb.RestClient.SetHeader("x-auth-token", fb.XAuthToken)
133+
fb.RestClient.SetBaseURL("https://" + fb.EndPoint + "/api/" + fb.ApiVersion)
130134
return fb
131135
}

0 commit comments

Comments
 (0)