Skip to content

Commit

Permalink
Now includes ability to set DEV_PASSWORD
Browse files Browse the repository at this point in the history
Closes #259
  • Loading branch information
tombeckenham committed Dec 8, 2024
1 parent 28fbdd2 commit adf500a
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/ui/views/Unlock/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,23 @@ const UsernameError: React.FC = () => (
</Box>
);

if (process.env.NODE_ENV !== 'development') {
if (!!process.env.DEV_PASSWORD) {
throw new Error('DEV_PASSWORD should only be set in development environment');
}
}

const DEFAULT_PASSWORD =
process.env.NODE_ENV === 'development' ? process.env.DEV_PASSWORD || '' : '';

const Unlock = () => {
const wallet = useWallet();
const classes = useStyles();
const [, resolveApproval] = useApproval();
const inputEl = useRef<any>(null);
// const { t } = useTranslation();
const [showError, setShowError] = useState(false);
const [password, setPassword] = useState('');
const [password, setPassword] = useState(DEFAULT_PASSWORD);
const [resetPop, setResetPop] = useState<boolean>(false);

useEffect(() => {
Expand Down

0 comments on commit adf500a

Please sign in to comment.