refresh test
This commit is contained in:
@@ -18,10 +18,21 @@ function RouteComponent() {
|
||||
const urlParams = new URLSearchParams(window.location.search)
|
||||
const redirect = urlParams.get('redirect')
|
||||
|
||||
if (redirect && !redirect.startsWith('/_serverFn')) {
|
||||
const isServerFunction = redirect && (
|
||||
redirect.startsWith('_serverFn') ||
|
||||
redirect.startsWith('api/') ||
|
||||
redirect.includes('_serverFn')
|
||||
);
|
||||
|
||||
if (redirect && !isServerFunction) {
|
||||
window.location.href = decodeURIComponent(redirect)
|
||||
} else {
|
||||
window.location.href = '/'
|
||||
const referrer = document.referrer;
|
||||
const referrerUrl = referrer && !referrer.includes('/_serverFn') && !referrer.includes('/api/')
|
||||
? referrer
|
||||
: '/';
|
||||
|
||||
window.location.href = referrerUrl;
|
||||
}
|
||||
} else {
|
||||
window.location.href = '/login'
|
||||
|
||||
Reference in New Issue
Block a user