Skip to content

Commit cc4392f

Browse files
committed
fix
1 parent 4b49517 commit cc4392f

File tree

2 files changed

+22
-23
lines changed

2 files changed

+22
-23
lines changed

apps/remix-ide/src/index.tsx

Lines changed: 21 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -3,33 +3,32 @@ 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'
109
import { Storage } from '@remix-project/remix-lib'
1110

1211
import { createRoot } from 'react-dom/client'
1312

14-
; (async function () {
15-
try {
16-
const configStorage = new Storage('config-v0.8:')
17-
const config = new Config(configStorage)
18-
Registry.getInstance().put({ api: config, name: 'config' })
19-
} catch (e) { }
20-
const theme = new ThemeModule()
21-
theme.initTheme()
13+
; (async function () {
14+
try {
15+
const configStorage = new Storage('config-v0.8:')
16+
const config = new Config(configStorage)
17+
Registry.getInstance().put({ api: config, name: 'config' })
18+
} catch (e) { }
19+
const theme = new ThemeModule()
20+
theme.initTheme()
2221

23-
const container = document.getElementById('root');
24-
const root = createRoot(container)
25-
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-
)
34-
}
35-
})()
22+
const container = document.getElementById('root');
23+
const root = createRoot(container)
24+
if (container) {
25+
if (window.location.hash.includes('source=github')) {
26+
root.render(
27+
<GitHubPopupCallback />
28+
)
29+
} else {
30+
root.render(
31+
<Preload root={root} />)
32+
}
33+
}
34+
})()

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)