Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use password type for inputs #26

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Use password type for inputs #26

wants to merge 2 commits into from

Conversation

ggorlen
Copy link

@ggorlen ggorlen commented Dec 28, 2022

Resolves #25

@bend-n
Copy link

bend-n commented Jan 11, 2023

Just a comment, instead of comparing the raw bufs, why not compare the strings directly?

@ggorlen
Copy link
Author

ggorlen commented Jan 11, 2023

Just a comment, instead of comparing the raw bufs, why not compare the strings directly?

I tried to follow the existing code's usage of raw bufs over strings. Presumably it's a security thing related to Why is char[] preferred over String for passwords? although OP would have to confirm their intent.

@mprimi
Copy link
Owner

mprimi commented Jan 12, 2023

Just a comment, instead of comparing the raw bufs, why not compare the strings directly?

I tried to follow the existing code's usage of raw bufs over strings. Presumably it's a security thing related to Why is char[] preferred over String for passwords? although OP would have to confirm their intent.

Crypto APIs work with byte arrays (Uint8Array), for obvious reasons (if not obvious let me know, I can explain why).

You could compare the two values as string, before turning them into byte arrays. That should be good enough.
(is there really no built-in to compare two arrays by value in JS...?)

Also, this PR is one commit that does 2 things:

  • Add a second "confirmation" password box
  • Change the password type field to 'password'

If you could split that into 2 commits, that increases the chances I'll review and merge this PR (no promises).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Suggestion] Use type="password" for password input field
3 participants