To log a user in, set url_redirect to the backends login url.
{
id: "login",
path: "login",
Component: components['redirect'],
handle: {
url_redirect: `${window.env.API_URL}/auth/login`
}
}
To log a user out where the backend requires method POST be used, ensure
you set url_post
{
id: "logout",
path: "logout",
Component: components['redirect'],
handle: {
url_post: `${window.env.API_URL}/auth/logout`,
url_redirect: `${window.env.API_URL}/auth/login`
}
}
This layout will cause a redirect to another URL, replacing the history with the url that was redirected to.
When defining the route for this layout, ensure that the route is defined with an
id. The id is used within the StateSplash text in formatRedirect ${id}.