Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

fix: Move CLI auth screen outside of dashboard#5755

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
BrunoQuaresma merged 1 commit intomainfrombq/fix-session-token-screen
Jan 17, 2023
Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletionssite/src/AppRouter.tsx
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -142,7 +142,6 @@ export const AppRouter: FC = () => {
<Route element={<DashboardLayout />}>
<Route index element={<IndexPage />} />

<Route path="cli-auth" element={<CliAuthenticationPage />} />
<Route path="gitauth" element={<GitAuthPage />} />

<Route path="workspaces" element={<WorkspacesPage />} />
Expand DownExpand Up@@ -241,11 +240,12 @@ export const AppRouter: FC = () => {
</Route>
</Route>

{/* Terminalpage don't have the dashboard layout */}
{/* Terminaland CLI auth pages don't have the dashboard layout */}
<Route
path="/@:username/:workspace/terminal"
element={<TerminalPage />}
/>
<Route path="cli-auth" element={<CliAuthenticationPage />} />
</Route>

{/* Using path="*"" means "match anything", so this route
Expand Down
11 changes: 6 additions & 5 deletionssite/src/components/SignInLayout/SignInLayout.tsx
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -15,11 +15,12 @@ export const useStyles = makeStyles((theme) => ({
},
container: {
marginTop: theme.spacing(-8),
minWidth: "320px",
maxWidth: "320px",
maxWidth: 385,
},
copyright: {
marginTop: theme.spacing(2),
footer: {
fontSize: 12,
color: theme.palette.text.secondary,
marginTop: theme.spacing(3),
},
}))

Expand All@@ -30,7 +31,7 @@ export const SignInLayout: FC<{ children: ReactNode }> = ({ children }) => {
<div className={styles.root}>
<div className={styles.layout}>
<div className={styles.container}>{children}</div>
<div className={styles.copyright}>
<div className={styles.footer}>
{`\u00a9 ${new Date().getFullYear()} Coder Technologies, Inc.`}
</div>
</div>
Expand Down
17 changes: 11 additions & 6 deletionssite/src/components/Welcome/Welcome.tsx
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -34,15 +34,20 @@ const useStyles = makeStyles((theme) => ({
justifyContent: "center",
},
logo: {
width: 80,
height: 56,
color: theme.palette.text.primary,
fontSize: theme.spacing(8),
},
title: {
fontSize: 24,
letterSpacing: -0.3,
marginBottom: theme.spacing(3),
marginTop: theme.spacing(6),
textAlign: "center",
fontSize: theme.spacing(4),
fontWeight: 400,
margin: 0,
marginBottom: theme.spacing(2),
marginTop: theme.spacing(2),
lineHeight: 1,

"& strong": {
fontWeight: 600,
},
},
}))
17 changes: 7 additions & 10 deletionssite/src/pages/CliAuthPage/CliAuthPage.tsx
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,21 @@
import { useActor } from "@xstate/react"
import { useContext, useEffect, useState, FC, PropsWithChildren } from "react"
import { useEffect, useState, FC, PropsWithChildren } from "react"
import { Helmet } from "react-helmet-async"
import { getApiKey } from "../../api/api"
import { pageTitle } from "../../util/page"
import { XServiceContext } from "../../xServices/StateContext"
import { CliAuthPageView } from "./CliAuthPageView"

export const CliAuthenticationPage: FC<PropsWithChildren<unknown>> = () => {
const xServices = useContext(XServiceContext)
const [authState] = useActor(xServices.authXService)
const { me } = authState.context
const [apiKey, setApiKey] = useState<string | null>(null)

useEffect(() => {
if (me?.id) {
void getApiKey().then(({ key }) => {
getApiKey()
.then(({ key }) => {
setApiKey(key)
})
}
}, [me?.id])
.catch((error) => {
console.error(error)
})
}, [])

return (
<>
Expand Down
1 change: 1 addition & 0 deletionssite/src/pages/CliAuthPage/CliAuthPageView.tsx
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -21,6 +21,7 @@ export const CliAuthPageView: FC<CliAuthPageViewProps> = ({ sessionToken }) => {
return (
<SignInLayout>
<Welcome message="Session token" />

<p className={styles.text}>
Copy the session token below and{" "}
<strong className={styles.lineBreak}>paste it in your terminal</strong>.
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp