raae/pow-app

Add edit password functionality

Closed this issue ยท 9 comments

raae commented

The user should be able to change their password.

Similar to change username.

raae commented

A good one to grab @olavea

Should we have a label associated with the nameattribute for better accessibility?

That's what Kent C. Dodds says
in this video

like this:

          <div>
            {/* adding a label - htmlFor="usernameInput" */}
            <label htmlFor="usernameInput">Username:</label>
            <input id="usernameInput" type="text" />
          </div>

In our code it would be something like this:

       <label htmlFor="yourNewPasSwordInput">
        

        <TextField
          id="yourNewPasSwordInput"


       </label>

raae commented

I think the text field from material ui adds a label. Inspect the code on the page and see if that is the case.

Ok
๐Ÿ˜ธ ๐Ÿ‘

Hey @raae
this is working in localhost now ๐Ÿ˜ธ
Should I add some error handling?

I found at least these error messages in the userbase docs:

CurrentPasswordMissing
CurrentPasswordIncorrect
PasswordAttemptLimitExceeded
PasswordMustBeString
PasswordCannotBeBlank
PasswordTooShort
PasswordTooLong

https://userbase.com/docs/sdk/update-user/

LILLIAN OLA BNEDICTE

raae commented

LILLIAN OLA BNEDICTE

Did an intern (๐Ÿฆ„ 5,5) join you for this mornings coding session?

raae commented

Yes you should probably do some error handling, something like this:

    const { error } = await dispatch(updateUser(...))
    if (error) {
      // Make error appear on screen
    } else {
      navigate(`/profile`)
    }

Supert!
I'll look into it!
๐Ÿ˜ธ