Skip to content

Commit

Permalink
fix: marketplace signin redirect (#2098)
Browse files Browse the repository at this point in the history
  • Loading branch information
meelrossi committed Jan 10, 2024
1 parent 5b28dff commit 216336e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
3 changes: 2 additions & 1 deletion webapp/config-overrides.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ const overridedConfig = override(
path.resolve(__dirname, 'node_modules/@cosmjs'),
path.resolve(__dirname, 'node_modules/cosmjs-types'),
path.resolve(__dirname, 'node_modules/ethers-multicall-provide'),
path.resolve(__dirname, 'node_modules/@noble')
path.resolve(__dirname, 'node_modules/@noble'),
path.resolve(__dirname, 'node_modules/decentraland-connect/node_modules/ethers')
])
)

Expand Down
9 changes: 7 additions & 2 deletions webapp/src/components/Navbar/Navbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,14 @@ const Navbar = (props: Props) => {
const handleOnSignIn = useCallback(() => {
const searchParams = new URLSearchParams(search)
const currentRedirectTo = searchParams.get('redirectTo')
const basename = /^decentraland.(zone|org|today)$/.test(
window.location.host
)
? '/marketplace'
: ''
const redirectTo = !currentRedirectTo
? `${pathname}${search}`
: currentRedirectTo
? `${basename}${pathname}${search}`
: `${basename}${currentRedirectTo}`
if (isAuthDappEnabled) {
window.location.replace(
`${config.get('AUTH_URL')}/login?redirectTo=${redirectTo}`
Expand Down

0 comments on commit 216336e

Please sign in to comment.