Email Verification

Hello,

I'm trying to send an email after the user does the registration, but it's not working.
I did the exact procedure with reset password, and it's ok.

What is missing, or what i'm doing wrong.

TY

what exactly does not work?
which response content do you get?

Taifun


Trying to push the limits! Snippets, Tutorials and Extensions from Pura Vida Apps by icon24 Taifun.

See the documentation, you need to supply the idToken in the POST section

https://firebase.google.com/docs/reference/rest/auth#section-send-email-verification

Hello,
Nothing, i don't receive any response. The log is made, but i don't receive the notification "please verify your email" as requested or an error message.

I did change taking into account
https://firebase.google.com/docs/reference/rest/auth#section-send-email-verification,
but same result, no response.

B1 B2

It is possible that the idToken is not "taking".

You either have to use the paid extension from Carlos Perdoza

or see here to use the web component:

Firebase with a Web Component

Also

Have a look at Taozilla's video:
Taozilla - 5. Firebase Authentication with app inventor ep02 update userinfo sendemail verify

from @ 9 minutes in. See his blocks

image

Hello, i tried with the video, but i really don't understand why his endpoint is different from the suggested in
https://firebase.google.com/docs/reference/rest/auth#section-send-email-verification

Google change things....

Did setting out the POST payload as Taozilla did make it work ?

No, but for me it's difficult just to see what he is doing without understanding what he's saying.
Because I wanted to use only the procedures he are using to verify email, not everything, I would love to keep what i have already done and it's working.

But if it is the only choice.

All you should have to do is change this:

image

to this:

image

You do not need to send as JSON
and probably remove your headers section

I already tryed and it's not working.
*When i save data (procedure), i can see the idToken in the label2_done

B2 B1

Try removing the web headers blocks ?

ok... i changed the when web GetText and the label that i set is showing code 400: Invalid ID Token

There lies your problem then. Use the data returned from sign up or in to get the up to date IdToken to use.

I have just tested all this on my setup and everything works as it should:

Sign Up data returned (with idToken) - truncated

Do It Result: 
"[
["email", "timai2@domain.co.uk"],
["expiresIn", "3600"],
["idToken", "eyJhbGciOiJSUzIXAiOiJKV1Qif..._mwsCape9jcN0RggEbhXqguwDA"],
["kind", "identitytoolkit#SignupNewUserResponse"],
["localId", "hw2Gztt7iThDOLTSfoY73SGTgDF2"], 
["refreshToken", "AG8BCne8Az...A8NGl8vmxCb1mUlX"]
]"

Send the verification email

data returned:

Do It Result: "{
  "kind": "identitytoolkit#GetOobConfirmationCodeResponse",
  "email": "timai2@domain.co.uk"
}
"

Email received:
image

Check the user data

data returned:

Do It Result: "{
  "kind": "identitytoolkit#GetAccountInfoResponse",
  "users": [
    {
      "localId": "hw2Gztt7iThDOLTSfoY73SGTgDF2",
      "email": "timai2@domain.co.uk",
      "passwordHash": "UkVEQUNURUQ=",
      "emailVerified": true,
      "passwordUpdatedAt": 1609683072990,
      "providerUserInfo": [
        {
          "providerId": "password",
          "federatedId": "timai2@domain.co.uk",
          "email": "timai2@domain.co.uk",
          "rawId": "timai2@domain.co.uk"
        }
      ],
      "validSince": "1609683072",
      "lastLoginAt": "1609683072990",
      "createdAt": "1609683072990",
      "lastRefreshAt": "2021-01-03T14:11:12.990Z"
    }
  ]
}
"
1 Like

Tim one more time, many thanks for your help ! 5*****

Solved !

thumbsup2

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.