Skip to content

Commit

Permalink
feat: set basename as auth (#28)
Browse files Browse the repository at this point in the history
  • Loading branch information
Melisa Anabella Rossi authored Dec 19, 2023
1 parent a5dc0e2 commit bea3f1f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/components/Pages/LoginPage/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export async function connectToProvider(connectionOption: ConnectionOptionType):
})

const url = new URL(window.location.href)
url.pathname = '/callback'
url.pathname = '/auth/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
3 changes: 3 additions & 0 deletions vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ export default defineConfig(({ command, mode }) => {

return {
plugins: [react()],
server: {
open: '/auth',
},
...(command === 'build'
? {
base: envVariables.VITE_BASE_URL,
Expand Down

0 comments on commit bea3f1f

Please sign in to comment.