Skip to content

Commit 424f954

Browse files
authored
fix: use password style for session token auth (coder#7533)
1 parent 2aea5b7 commit 424f954

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

site/src/components/CodeExample/CodeExample.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ export interface CodeExampleProps {
1111
buttonClassName?: string
1212
tooltipTitle?: string
1313
inline?: boolean
14+
password?: boolean
1415
}
1516

1617
/**
@@ -39,6 +40,7 @@ export const CodeExample: FC<React.PropsWithChildren<CodeExampleProps>> = ({
3940

4041
interface styleProps {
4142
inline?: boolean
43+
password?: boolean
4244
}
4345

4446
const useStyles = makeStyles<Theme, styleProps>((theme) => ({
@@ -61,5 +63,6 @@ const useStyles = makeStyles<Theme, styleProps>((theme) => ({
6163
display: "flex",
6264
alignItems: "center",
6365
wordBreak: "break-all",
66+
"-webkit-text-security": (props) => (props.password ? "disc" : undefined),
6467
},
6568
}))

site/src/pages/CliAuthPage/CliAuthPageView.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export const CliAuthPageView: FC<CliAuthPageViewProps> = ({ sessionToken }) => {
2727
<strong className={styles.lineBreak}>paste it in your terminal</strong>.
2828
</p>
2929

30-
<CodeExample code={sessionToken} />
30+
<CodeExample code={sessionToken} password />
3131

3232
<div className={styles.links}>
3333
<Button component={RouterLink} size="large" to="/workspaces" fullWidth>

0 commit comments

Comments
 (0)