Skip to content

Commit 8e4010d

Browse files
committed
Modified DoiT API auth endpoint
1 parent 9dac675 commit 8e4010d

File tree

3 files changed

+6
-7
lines changed

3 files changed

+6
-7
lines changed

examples/main.tf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ terraform {
22
required_providers {
33
doit = {
44
source = "doitintl/doit"
5-
version = "0.23.0"
5+
version = "0.24.0"
66
}
77
}
88
}
@@ -24,11 +24,11 @@ resource "doit_budget" "my_budget" {
2424
}
2525
]
2626
recipients = [
27-
"diana@doit.com"
27+
"test@doit.com"
2828
]
2929
collaborators = [
3030
{
31-
"email" : "diana@doit.com",
31+
"email" : "test@doit.com",
3232
"role" : "owner"
3333
},
3434
]

examples/provider/provider.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ terraform {
22
required_providers {
33
doit = {
44
source = "doitintl/doit"
5-
version = "0.23.0"
5+
version = "0.24.0"
66
}
77
}
88
}

internal/provider/client.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ func NewClientTest(host, doiTAPIClient, customerContext *string, rl *rate.Limite
4949
if host != nil {
5050
c.HostURL = *host
5151
}
52-
5352
_, err := c.SignIn()
5453
if err != nil {
5554
return nil, err
@@ -67,7 +66,7 @@ func (c *ClientTest) SignIn() (*AuthResponseTest, error) {
6766
// return nil, err
6867
//}
6968

70-
url_ccontext := "/?customerContext=" + c.Auth.CustomerContext
69+
url_ccontext := "/auth/v1/validate?customerContext=" + c.Auth.CustomerContext
7170
req, err := http.NewRequest("GET", c.HostURL+url_ccontext, nil)
7271
if err != nil {
7372
return nil, err
@@ -149,7 +148,7 @@ func (c *ClientTest) doRequest(req *http.Request) ([]byte, error) {
149148
func addContextToURL(context, url string) (urlContext string) {
150149
urlContext = url
151150
if len(strings.TrimSpace(context)) != 0 {
152-
urlContext = fmt.Sprintf("url?customerContext=%s", context)
151+
urlContext = fmt.Sprintf(url+"?customerContext=%s", context)
153152
}
154153
return urlContext
155154
}

0 commit comments

Comments
 (0)