https://supertokens.com/ logo
a

ashlite

06/15/2022, 1:45 PM
Some issues I'm encounter right now, its been a day and I can't get it to work, my dependencies: - NEXT JS v12.1.6 - React v18.1 - supertoken-auth-react v0.22.2 First problem is modifying the added input from text type to password, search from the discord and found this method to modify the frontend config but it doesn't work for me. console return null. input still in text. My goal is to make confirmation input for password
Copy code
js
override:{
  components:{
    EmailPasswordSignUpForm_Override:({DefaultComponent, ...props}) => {
      useEffect(() => {
        const passwordConfirm = document.querySelector('input[name="passwordConfirm"]')
        console.log(passwordConfirm) //for checking purpose
        if (passwordConfirm){
          passwordConfirm.setAttribute("type", "password")
        }
      }, [])
      return <DefaultComponent {...props} />
      }
    }
  }
r

rp

06/15/2022, 1:47 PM
hey @ashlite
a

ashlite

06/15/2022, 1:48 PM
hi
r

rp

06/15/2022, 1:48 PM
You might wanna try:
Copy code
document.querySelector("#supertokens-root").shadowRoot.querySelector('input[name="passwordConfirm"]')
a

ashlite

06/15/2022, 1:50 PM
ahhh.... so for all dom selector, we need to use shadowRoot?
r

rp

06/15/2022, 1:51 PM
yes
a

ashlite

06/15/2022, 1:53 PM
okay I have the problem with protecting route, do I need to open a new thread?
r

rp

06/15/2022, 1:53 PM
yes please