replit / desktop

Replit Desktop App
116 stars 7 forks source link

Validate URL in open repl window handler #82

Closed sergeichestakov closed 1 year ago

sergeichestakov commented 1 year ago

Why

Similar to https://github.com/replit/desktop/pull/80, we want to validate that the URL is valid when handling this message to prevent arbitrary navigation around the web app.

What changed

Validate URL in open repl window handler

Test plan

openReplUrl works as expected but does not allow any non-valid page

sergeichestakov commented 1 year ago

yeah a modal comes up. it's not the best UX tbh but it does offer some detail as to what happened

szymonkaliski commented 1 year ago

Cool thanks, yeah I think as long as you get some feedback as a user it's fine.

sergeichestakov commented 1 year ago

yeah. I do think we should reserve throwing errors like these for invariants though because it's not super friendly (shows a stack trace and stuff). for user-facing errors we should show a dialog box