You can find a demo at https://webflow-authentication.webflow.io/sign-up.
Log in to Firebase console. Create a new app and from the left side menu, under Develop, navigate to Authentication. Enable Email/Password sign-in provider. After this, create a Web application under the current Firebase project and copy the given firebaseConfig object.
Go to the project settings and Custom Code tab. Add content from webflow-custom-code-before-body.html gist file to Footer Code input. Replace webflowAuth.firebaseConfig with the one you copied in the previous step. After this go to designer and create 3 new pages:
/userpage which is meant for logged in users./log-inpage which is used for logging in./sign-uppage which is used for signing up.
On /sign-up page, create a form and inside it add a submit button plus two input fields - email and password. Then do the following adjustments:
- Give form element (form element inside form, Form > Form) custom data attribute called
data-signup-form. - Give email field custom data attribute called
data-signup-email. - Give password field custom data attribute called
data-signup-password. - Give form error element custom data attribute called
data-signup-error. - Add custom data attribute called
data-user-unauthto the body element.
On /log-in page, create a form and inside it add a submit button plus two input fields - email and password. Then do the following adjustments:
- Give form element (form element inside form, Form > Form) custom data attribute called
data-login-form. - Give email field custom data attribute called
data-login-email. - Give password field custom data attribute called
data-login-password. - Give form error element custom data attribute called
data-login-error. - Add custom data attribute called
data-user-unauthto the body element.
On /user page add custom data attribute called data-user-auth to the body element. In addition to this, you can show any user properties returned from Firebase by giving an element custom data attribute called data-user. After this you can use user properties with curly bracets i.e. Your email is {{email}}.
If you have a navigation element from which you can navigate to /log-in, /sign-up etc. pages, you can adjust their visibility by using custom data attributes called data-user-auth and data-user-unauth. You can also add either one of those data attributes to body element which will adjust visibility of the given page. Log out button can be created by giving a link element a custom data attribute called data-logout.
Some of the ideas are taken from the YouTube video series by Jason Dark which you can find at https://www.youtube.com/watch?v=30AIpEnsEaQ&list=PL4TuDUnZkkhzSwfbFj6EJjxim6218ORc0.

NEVERMIND figured it out again lol
Under the onAuthStateChanged add something like this:
document.getElementById("btnVerifyEmail").addEventListener('click', function (event) { user.sendEmailVerification() .then(function () { document.getElementById("btnVerifyEmail").style.display = "none"; console.log("Sent verification email") }) .catch(function (error) { console.log("Oops! There was an error sending verification email.") }); })