Logo-amall

Hello i use nextjs packages. const onSubmit = async (data: FormData) => { const { email, password } = data const response = await signInEmailPassword(email, password) if (isError && !isLoading) { // console.log(signInError, "signInError"); setError('email', { type: 'manual', message: 'Email or Password is invalid' }) } console.log(response, 'response without success') console.log(isAuthenticated, 'isAuthenticated') console.log(isError, 'is Error') if (isSuccess) console.log(response, 'login success') console.log(error, 'signInError') if (needsEmailVerification) { setError('email', { type: 'manual', message: 'Email verification is required' }) } } When i try to login i can't see any changes. But i can see messages,errors in returned response. When i press second time i get previous auth state.

Last active 4 months ago

7 replies

9 views

  • EM

    Hello i use nextjs packages.

    const onSubmit = async (data: FormData) => {
    const { email, password } = data

    const response =  await signInEmailPassword(email, password)
    
    if (isError && !isLoading) {
      // console.log(signInError, "signInError");
      setError('email', {
        type: 'manual',
        message: 'Email or Password is invalid'
      })
    }
    console.log(response, 'response without success')
    console.log(isAuthenticated, 'isAuthenticated')
    console.log(isError, 'is Error')
    if (isSuccess) console.log(response, 'login success')
    console.log(error, 'signInError')
    if (needsEmailVerification) {
      setError('email', {
        type: 'manual',
        message: 'Email verification is required'
      })
    }
    

    }

    When i try to login i can't see any changes. But i can see messages,errors in returned response. When i press second time i get previous auth state.

  • EL

    I'm not sure I understand the issue. What's the bug here exactly?

  • EM

    When i sign in, isAuthenticated state doesnt update.

  • EL

    If I look at the screenshot it seems that the sign-in process failed (incorrect email or password) and the isAuthenticated is still false.

  • EL

    Can you try to successfully sign in and see if it changes?

  • EM
  • EM

Last active 4 months ago

7 replies

9 views