Skip to content

Commit

Permalink
feat: set basename as auth
Browse files Browse the repository at this point in the history
  • Loading branch information
Melisa Anabella Rossi committed Dec 19, 2023
1 parent a5dc0e2 commit 300c312
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
3 changes: 2 additions & 1 deletion src/components/Pages/LoginPage/utils.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { useHref } from 'react-router-dom'
import { ethers } from 'ethers'
import { AuthIdentity, Authenticator } from '@dcl/crypto'
import { ProviderType } from '@dcl/schemas/dist/dapps/provider-type'
Expand Down Expand Up @@ -62,7 +63,7 @@ export async function connectToProvider(connectionOption: ConnectionOptionType):
})

const url = new URL(window.location.href)
url.pathname = '/callback'
url.pathname = useHref({ pathname: '/callback' })

await magic.oauth.loginWithRedirect({
provider: connectionOption,
Expand Down
4 changes: 1 addition & 3 deletions src/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,9 @@ import { LoginPage } from './components/Pages/LoginPage'
import 'decentraland-ui/dist/themes/alternative/dark-theme.css'
import './index.css'

const basename = /^decentraland.(zone|org|today)$/.test(window.location.host) ? '/auth' : '/'

ReactDOM.render(
<React.StrictMode>
<BrowserRouter basename={basename}>
<BrowserRouter basename="/auth">
<Routes>
<Route path="/login" element={<LoginPage />} />
<Route path="/callback" element={<CallbackPage />} />
Expand Down

0 comments on commit 300c312

Please sign in to comment.