Skip to content
This repository was archived by the owner on May 19, 2020. It is now read-only.

Commit ed4c63f

Browse files
Merge pull request #1142 from 18F/js-fix-invite-new-user
Js fix invite flow for new user
2 parents a783dd5 + 0ef464b commit ed4c63f

2 files changed

Lines changed: 4 additions & 20 deletions

File tree

controllers/uaa.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,8 @@ func (c *UAAContext) InviteUserToOrg(rw web.ResponseWriter, req *web.Request) {
251251
err.writeTo(rw)
252252
return
253253
}
254+
// Set the user info that get from the newly invited user.
255+
getUserResp.ID = userInvite.UserID
254256
}
255257

256258
rw.WriteHeader(http.StatusOK)

controllers/uaa_test.go

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -89,12 +89,6 @@ var inviteUsersTest = []BasicProxyTest{
8989
ResponseCode: http.StatusOK,
9090
Response: "{\"resources\": [{\"active\": true, \"verified\": false, \"id\": \"user-guid\", \"externalId\": \"user-guid@domain.com\" }]}",
9191
},
92-
{
93-
RequestMethod: "GET",
94-
ExpectedPath: "/Users/user-guid",
95-
ResponseCode: http.StatusOK,
96-
Response: "{\"active\": true, \"verified\": false, \"id\": \"user-guid\", \"externalId\": \"user-guid@domain.com\" }",
97-
},
9892
{
9993
RequestMethod: "POST",
10094
ExpectedPath: "/v2/users",
@@ -128,12 +122,6 @@ var inviteUsersTest = []BasicProxyTest{
128122
ResponseCode: http.StatusOK,
129123
Response: "{\"resources\": [{\"active\": true, \"verified\": false, \"id\": \"user-guid\", \"externalId\": \"user-guid@domain.com\" }]}",
130124
},
131-
{
132-
RequestMethod: "GET",
133-
ExpectedPath: "/Users/user-guid",
134-
ResponseCode: http.StatusOK,
135-
Response: "{\"active\": true, \"verified\": false, \"id\": \"user-guid\", \"externalId\": \"user-guid@domain.com\" }",
136-
},
137125
{
138126
RequestMethod: "POST",
139127
ExpectedPath: "/v2/users",
@@ -144,7 +132,7 @@ var inviteUsersTest = []BasicProxyTest{
144132
{
145133
BasicSecureTest: BasicSecureTest{
146134
BasicConsoleUnitTest: BasicConsoleUnitTest{
147-
TestName: "UAA Invite User with e-mail in body",
135+
TestName: "UAA Invite User with e-mail in body (new user)",
148136
SessionData: ValidTokenData,
149137
EnvVars: GetMockCompleteEnvVars(),
150138
},
@@ -165,13 +153,7 @@ var inviteUsersTest = []BasicProxyTest{
165153
RequestMethod: "GET",
166154
ExpectedPath: "/Users?filter=email+eq+%22test%40example.com%22",
167155
ResponseCode: http.StatusOK,
168-
Response: "{\"resources\": [{\"active\": true, \"verified\": false, \"id\": \"user-guid\", \"externalId\": \"user-guid@domain.com\" }]}",
169-
},
170-
{
171-
RequestMethod: "GET",
172-
ExpectedPath: "/Users/user-guid",
173-
ResponseCode: http.StatusOK,
174-
Response: "{\"active\": true, \"verified\": false, \"id\": \"user-guid\", \"externalId\": \"user-guid@domain.com\" }",
156+
Response: "{\"resources\": []}",
175157
},
176158
{
177159
RequestMethod: "POST",

0 commit comments

Comments
 (0)