password field only for nsec

This commit is contained in:
vivganes 2023-04-08 15:29:11 +05:30
parent 247a407df6
commit 77325be3e2

View File

@ -279,12 +279,20 @@ export default function LoginPage() {
<div className="flex">
<input
dir="auto"
type="password"
type={key?.startsWith("nsec") ? "password" : "text"}
placeholder={formatMessage(messages.KeyPlaceholder)}
className="f-grow"
onChange={e => setKey(e.target.value)}
/>
</div>
<p className="login-note">
{key?.startsWith("nsec") && (
<span className="highlight">
We noticed that you are entering a secret key starting with nsec. We are masking your input to protect
your privacy.
</span>
)}
</p>
{error.length > 0 ? <b className="error">{error}</b> : null}
<p className="login-note">
<FormattedMessage