Skip to content

Commit 6591890

Browse files
authored
Merge pull request #6092 from ethereum/routingfix
login route fix
2 parents 9ffe3b7 + 5ab8d16 commit 6591890

File tree

2 files changed

+9
-10
lines changed

2 files changed

+9
-10
lines changed

apps/remix-ide/src/index.tsx

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import React from 'react'
33
import './index.css'
44
import { ThemeModule } from './app/tabs/theme-module'
55
import { Preload } from './app/components/preload'
6-
import { BrowserRouter, Routes, Route } from 'react-router-dom'
76
import { GitHubPopupCallback } from './app/pages/GitHubPopupCallback'
87
import Config from './config'
98
import { Registry } from '@remix-project/remix-lib'
@@ -23,13 +22,13 @@ import { createRoot } from 'react-dom/client'
2322
const container = document.getElementById('root');
2423
const root = createRoot(container)
2524
if (container) {
26-
root.render(
27-
<BrowserRouter>
28-
<Routes>
29-
<Route path="/auth/github/callback" element={<GitHubPopupCallback />} />
30-
<Route path="*" element={<Preload root={root} />} />
31-
</Routes>
32-
</BrowserRouter>
33-
)
25+
if (window.location.hash.includes('source=github')) {
26+
root.render(
27+
<GitHubPopupCallback />
28+
)
29+
} else {
30+
root.render(
31+
<Preload root={root} />)
32+
}
3433
}
3534
})()

libs/remix-ui/git/src/components/github/devicecode.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ export const GetDeviceCode = () => {
4949
}
5050

5151
const clientId = await getClientId()
52-
const redirectUri = `${window.location.origin}/auth/github/callback`
52+
const redirectUri = `${window.location.origin}/?source=github`
5353
const scope = 'repo gist user:email read:user'
5454

5555
const url = `https://github.com/login/oauth/authorize?client_id=${clientId}&redirect_uri=${encodeURIComponent(redirectUri)}&scope=${encodeURIComponent(scope)}&response_type=code`

0 commit comments

Comments
 (0)