Skip to content

Commit

Permalink
DXCDT-550: Add success message on auth0 ul customize cmd (#883)
Browse files Browse the repository at this point in the history
  • Loading branch information
sergiught authored Oct 18, 2023
1 parent b86b485 commit 0493b3f
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions internal/cli/universal_login_customize.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ const (
fetchPromptMessageType = "FETCH_PROMPT"
saveBrandingMessageType = "SAVE_BRANDING"
errorMessageType = "ERROR"
successMessageType = "SUCCESS"
)

type (
Expand Down Expand Up @@ -53,6 +54,10 @@ type (
Error string `json:"error"`
}

successData struct {
Success bool `json:"success"`
}

webSocketHandler struct {
shutdown context.CancelFunc
display *display.Renderer
Expand Down Expand Up @@ -504,6 +509,17 @@ func (h *webSocketHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {

continue
}

successMsg := webSocketMessage{
Type: successMessageType,
Payload: &successData{
Success: true,
},
}

if err := connection.WriteJSON(&successMsg); err != nil {
h.display.Errorf("Failed to send success message: %v", err)
}
}
}
}
Expand Down

0 comments on commit 0493b3f

Please sign in to comment.