Skip to content

Commit

Permalink
Default password for demo
Browse files Browse the repository at this point in the history
  • Loading branch information
githubsaturn committed Oct 24, 2024
1 parent bc6ed47 commit 9e5ab67
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/containers/Login.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,19 @@ class NormalLoginForm extends React.Component<
otpEntered: string
}
> {
isDemo: boolean = false
constructor(props: any) {
super(props)

try {
const urlSearchParams = new URLSearchParams(window.location.search)
//@ts-ignore
const params = Object.fromEntries(urlSearchParams.entries())
this.isDemo = !!params.demo
} catch (e) {
console.error(e)
}

this.state = {
loginOption: NO_SESSION,
passwordEntered: ``,
Expand All @@ -144,6 +155,7 @@ class NormalLoginForm extends React.Component<
return (
<form onSubmit={this.handleSubmit}>
<Input.Password
defaultValue={this.isDemo ? 'captain42' : ''}
required
onKeyDown={(key) => {
if (
Expand Down

0 comments on commit 9e5ab67

Please sign in to comment.