medusa-ui/medusa

Rewrite: Forward to another page

Closed this issue · 0 comments

This should be a backend call, a certain kind of Attribute that gets returned that causes a forward to another page.

We'll need to write some JS for this.

Core idea is:
It's easy to forward someone to another page from the browser (that's just a hyperlink!). But it's hard to do something like:

  • Click a button
  • Run some controller method
  • Once controller method is completed, move to another page

So I propose we introduce some kind of Attribute which is a redirect attribute. Upon retrieval of such an event in JS, we redirect the user (keeping history intact).

By default, I would say this can only redirect to pages internally in the application. If the redirect would happen outside of the application, you need to explicitly turn on a property.