0
votes

I successfully sent a verification email to the client here is the Sample Email

here is my code for the email action handler

<script src="https://www.gstatic.com/firebasejs/7.16.1/firebase.js"></script>


<script>
        document.addEventListener('DOMContentLoaded', function() {
            var config = {
                'apiKey': "my api key here"
            }

            var app = firebase.initializeApp(config);
            var auth = app.auth();

            var mode = "<?php echo $_GET['mode'];?>"
            var actionCode = "<?php echo $_GET['oobCode'];?>"

            auth.applyActionCode(actionCode).then(function(resp) {
                console.log(resp)
                document.getElementById('message').textContent = "Success! Email Verified"
            }).catch(function(error) {
                document.getElementById('message').textContent = "There was an error verifying your email"
            })

        })
 </script>

this will print Success! Email Verified

I checked the client account and still its not verified

My question is why clicking the link does not verify the client account?

1
How did you check the client account? Keep in mind that this call will not automatically refresh the user profile in your application code. You will need to sign-out/sign-in or reload the user profile before the update shows up in the client-side code.Frank van Puffelen

1 Answers

0
votes

Calling auth.applyActionCode(actionCode) will not automatically refresh the user profile in your application code. You will need to sign-out/sign-in or reload the user profile before the update shows up in the client-side code.

Also see: