Skip to content

Commit ee8950e

Browse files
leggetterclaudecursoragent
committed
fix(cli-guest): omit device_name from guest link refresh payload
Refresh calls POST /cli/guest with link_context only; empty device_name was rejected by server Joi validation (422). Add omitempty and assert the key is absent in unit and guest acceptance tests. Co-Authored-By: Claude <noreply@anthropic.com> Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent acad4fe commit ee8950e

3 files changed

Lines changed: 3 additions & 1 deletion

File tree

pkg/hookdeck/guest.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ type GuestSigninLinkResponse struct {
2323
}
2424

2525
type CreateGuestUserInput struct {
26-
DeviceName string `json:"device_name"`
26+
DeviceName string `json:"device_name,omitempty"`
2727
LinkContext string `json:"link_context,omitempty"`
2828
}
2929

pkg/login/guest_link_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ func TestRefreshGuestSigninLink_updatesProfileOnSuccess(t *testing.T) {
2828
var input map[string]string
2929
require.NoError(t, json.NewDecoder(r.Body).Decode(&input))
3030
require.Equal(t, "signup", input["link_context"])
31+
require.NotContains(t, input, "device_name")
3132
body, err := json.Marshal(map[string]string{
3233
"id": "usr_guest_refresh",
3334
"key": "hk_test_guest_refresh_key12",

test/acceptance/guest_login_acceptance_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,7 @@ func TestGuestLoginDefaultClaimGuestAcceptance(t *testing.T) {
158158
var payload map[string]interface{}
159159
require.NoError(t, json.NewDecoder(r.Body).Decode(&payload))
160160
require.Equal(t, "signup", payload["link_context"])
161+
require.NotContains(t, payload, "device_name")
161162

162163
body, encErr := json.Marshal(map[string]string{
163164
"id": "usr_guest_accept",

0 commit comments

Comments
 (0)