[portal][feat] allow customization of login redirect

This commit is contained in:
Tay Yang Shun
2022-10-31 18:53:45 +08:00
parent 960ffdc8dc
commit e7431867c2

View File

@@ -1,8 +1,11 @@
export default function loginPageHref() {
export default function loginPageHref(redirectUrl?: string) {
return {
pathname: '/login',
query: {
redirect: typeof window !== 'undefined' ? window.location.href : null,
redirect:
typeof window !== 'undefined'
? redirectUrl ?? window.location.href
: null,
},
};
}