<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Anas Mammeri on Medium]]></title>
        <description><![CDATA[Stories by Anas Mammeri on Medium]]></description>
        <link>https://medium.com/@anas.mammeri?source=rss-7acba3a309af------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*Sp6pcXefVRJvEB7XaVwVaw.png</url>
            <title>Stories by Anas Mammeri on Medium</title>
            <link>https://medium.com/@anas.mammeri?source=rss-7acba3a309af------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 14 Nov 2026 08:17:43 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@anas.mammeri/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Vue 2 + Firebase: How to add Firebase Social Sign In into your Vue application]]></title>
            <link>https://medium.com/@anas.mammeri/vue-2-firebase-how-to-add-firebase-social-sign-in-into-your-vue-application-21f341bbf1b?source=rss-7acba3a309af------2</link>
            <guid isPermaLink="false">https://medium.com/p/21f341bbf1b</guid>
            <category><![CDATA[vue]]></category>
            <category><![CDATA[social-sign-in]]></category>
            <category><![CDATA[vuejs]]></category>
            <category><![CDATA[firebase]]></category>
            <category><![CDATA[oauth]]></category>
            <dc:creator><![CDATA[Anas Mammeri]]></dc:creator>
            <pubDate>Mon, 03 Dec 2018 17:50:11 GMT</pubDate>
            <atom:updated>2018-12-05T12:24:23.777Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/308/1*OfN5-O2x12w3K2M_UrTVDQ.png" /></figure><p>In this tutorial, we will see how to quickly add the Firebase Social Sign In feature into your Vue application.</p><p>I previously wrote a tutorial on <a href="https://medium.com/@anas.mammeri/vue-2-firebase-how-to-build-a-vue-app-with-firebase-authentication-system-in-15-minutes-fdce6f289c3c">how to build a Vue app with Firebase authentication system</a>, and if you didn’t read it before, I advise you to quickly take a look at it, since I will use it as a base for this tutorial.</p><p>If you already have, then you can consider this new one like the part II ;)</p><h3>What Is Social Sign In?</h3><pre>Social Login is single sign-on for end users. Using existing login information from a social network provider like <strong><em>Facebook</em></strong>, <strong><em>Twitter</em></strong>, or <strong><em>Google</em></strong>, the user can sign into a third party website instead of creating a new account specifically for that website. This simplifies registrations and logins for end users.</pre><pre><em>from auth0.com</em>: <a href="https://auth0.com/learn/social-login/">https://auth0.com/learn/social-login/</a></pre><p>In summary, Social Sign In allows you to connect to different applications without having to create each time a new account.</p><h3>Firebase Social Sign In feature</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iw0k8dVV5WkmKpoQeni5ig.png" /></figure><p>Firebase comes with a powerful authentication system. This system allows you to either create account manually, with the traditional email/password combination (as shown in <a href="https://medium.com/@anas.mammeri/vue-2-firebase-how-to-build-a-vue-app-with-firebase-authentication-system-in-15-minutes-fdce6f289c3c">my previous tutorial</a>), or use some pre-defined methods to authenticate your users with OAuth into your application. (And if you want, with Firebase, you can even authenticate your users using their phone numbers!)</p><p>The providers available are <strong>Google</strong>, <strong>Facebook</strong>, <strong>Twitter</strong>, <strong>Github</strong> and <strong>Play Games</strong>.</p><p>In this tutorial, we will use the <strong>Google</strong> social sign-in provider as an example, since the other providers require to have specific API keys. But don’t be afraid, all the methods are very similar, so if you implement the Social Sign In feature with one provider, you’ll be able to easily replicate it with all other providers!</p><h3>Let’s start!</h3><p>As said in the introduction, for this tutorial, we will continue from where we left in <a href="https://medium.com/@anas.mammeri/vue-2-firebase-how-to-build-a-vue-app-with-firebase-authentication-system-in-15-minutes-fdce6f289c3c"><strong>How to build a Vue app with Firebase authentication system in 15 minutes</strong></a><strong>.</strong></p><p>If you don’t want to go over the full tutorial, that’s fine, here is a <strong>small recap:</strong></p><p>We created a Vue application that contains three views, two (<em>Login</em> view and <em>Sign Up</em> view) that we can access only without authentication, and one (<em>Home</em> view) that we can access only with authentication.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/574/1*op9JPf3Ud_Gr3VMV2CdfCg.png" /></figure><p>Using Firebase and vue-router, we implemented the navigation of the app. The <em>Login view </em>allows you to connect to your application, and the <em>Sign Up view </em>allows you to create an account, using email/password combination. After login successfully or after a new account creation, the app redirect you to the authenticated part of the app, the <em>Home</em> view. If you try to access a view that requires authentication without being actually authenticated, it redirects you to the Login view, and vice versa.</p><p>All the implementation of the account creation, the login with email/password, and the navigation between views is <strong><em>already done. </em></strong>You can find all the source in: <a href="https://github.com/CaptainYouz/vue-firebase-tutorial">https://github.com/CaptainYouz/vue-firebase-tutorial</a>.</p><h3>LET’S WRITE SOME CODE!</h3><p>For this new tutorial, we will add the <strong>Social Sign In</strong> feature of Firebase in the <em>Login view.</em></p><p>To do so, there is two possible solutions. The first one, is to create a simple html button and trigger the Firebase social sign in method on click, and the second one, is to use <strong>FirebaseUI.</strong></p><pre>FirebaseUI is an open-source JavaScript library for Web that provides simple, customizable UI bindings on top of Firebase SDKs. </pre><pre>documentation: <a href="https://firebase.google.com/docs/auth/web/firebaseui">https://firebase.google.com/docs/auth/web/firebaseui</a></pre><p>For this tutorial, we will go manually and do the first solution, since we already have everything in place for our Login process.</p><h3>Step One: Adding the Social Sign In button to the Login view</h3><p><strong>1–1 Create the html/css</strong></p><p>Let’s <a href="https://github.com/captainyouz/vue-firebase-tutorial">clone our application from Github</a> and install all the dependencies by running npm install.</p><p>When everything is installed, let’s start our application by running npm run start , open the app in our web browser (url: <a href="http://localhost:8080)">http://localhost:8080)</a> and take a look at the current <em>Login view. </em>We should have something like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/921/1*GIKXdiD2b0CrIitXGRX26A.png" /><figcaption>Login View</figcaption></figure><p>Now, let’s open our <strong>Login</strong> component in src/views/Login.vue and add the part where our Social Sign In button will be displayed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*k13vgHo6tp5XaKmFdahQYg.png" /></figure><p>I’ve created a button with an image inside, image that I have download <a href="https://www.iconfinder.com/icons/682665/favicon_google_logo_new_icon">here</a> and saved inside the /assets directory under the name google-logo.png .</p><p>Also, I’ve created some style for the beauty of our social sign in button ;)</p><p>So now, or <em>Login view</em> should look like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LUQ39VZupceZr12ATyjdDw.png" /><figcaption>login view</figcaption></figure><p>Now that we have everything ready in our <em>Login view</em>, let’s add the logic to login into our app with a Google account.</p><h3>Step Two: Connect with a Google account using Firebase Authentication</h3><p>To do so, you’ll first need to enable Social Sign In authentication with Google provider in your Firebase app. Go to <a href="http://console.firebase.google.com/">console.firebase.google.com</a> and select your project, then go to the authentication view and select the ‘<strong>Sign-In Method</strong>’<strong> </strong>tab.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fGXtgjtE9pdh5XblIQAVMA.png" /><figcaption>Firebase Sign In Method tab</figcaption></figure><p>Then, in this view, select the <strong>Google </strong>provider and <strong>enable it.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*g5L2R6a1z_ciGl7dkXdu0Q.png" /><figcaption>enable Google sign in</figcaption></figure><p>click on <strong>Save </strong>and voila! You now have your Firebase project ready to authenticate users using their Google accounts. Let’s now see how to implement the code.</p><p><strong>2–1 Add the Firebase method</strong></p><p>To connect using Social Sign In, first of all, you’ll need to get back the corresponding social <strong>provider </strong>you want to login with. In our case, as said before, we are going to use <strong>Google provider</strong>. To get back the <strong>Google provider</strong> with Firebase, we are going to use a Firebase method of the auth object, called GoogleAuthProvider (doc: <a href="https://firebase.google.com/docs/reference/js/firebase.auth.GoogleAuthProvider">https://firebase.google.com/docs/reference/js/firebase.auth.GoogleAuthProvider</a>).</p><p>Then, we’ll need our users to sign in with this <strong>provider</strong>, and with Firebase, you can do so either by opening a pop-up window or by redirecting to a sign-in page. To have more information about those two solutions, you can check the Firebase doc here (part 5): <a href="https://firebase.google.com/docs/auth/web/google-signin">https://firebase.google.com/docs/auth/web/google-signin</a>.</p><p>In our case, since we want to do an action (redirecting) after the login, we are going to use the pop up method.</p><p>The method to open a popup is called signInWithPopup and is very similar to our previous signInWithEmailAndPassword . The api documentation says:</p><pre>signInWithPopup(provider) returns <a href="https://firebase.google.com/docs/reference/js/firebase.Promise.html">firebase.Promise</a> containing non-null <a href="https://firebase.google.com/docs/reference/js/firebase.auth.html#.UserCredential">firebase.auth.UserCredential</a></pre><pre>Authenticates a Firebase client using a popup-based OAuth authentication flow.</pre><pre>If succeeds, returns the signed in user along with the provider&#39;s credential. If sign in was unsuccessful, returns an error object containing additional information about the error.<br>from: <a href="https://firebase.google.com/docs/reference/js/firebase.auth.Auth">https://firebase.google.com/docs/reference/js/firebase.auth.Auth</a></pre><p>So, that’s perfect for our use case. Now let’s translate this into code. In our Login.vue file:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*h-70Dp6gJWgGN-j2ELmRXg.png" /></figure><p>We attach the click event of our Google button to the socialLogin method. In this method, as said before, we first get back an instance of the <strong>Google provider</strong> object, then we authenticate users using the signInWithPopup method.</p><p>The callback for our success response is a simple function that redirects the user to the <em>Home view</em>. (The result parameter contains information about the user.) In this case, the user has successfully login with his Google account.</p><p>If something went wrong during the social login, in our error callback, we display the error message in an alert (the catch function). To know more about the type of possible error of social sign in, you can check the doc here: <a href="https://firebase.google.com/docs/reference/js/firebase.auth.Auth#signInWithPopup">https://firebase.google.com/docs/reference/js/firebase.auth.Auth#signInWithPopup</a></p><p>You can also notice that the success and error callbacks are exactly the same as the ones in our signInWithEmailAndPassword. If your app logic is the same after login with email/password and social account, you can even factorize this code and use the same callback functions for both signInWithEmailAndPassword and signInWithPopup.</p><p>Now, if you click on the Google button we created before, you should have the Google Authentication popup open. After choosing your Google account, the popup should disappear and you should be redirect to the home view.</p><p>And that is <em>basically it</em>! You have now authenticated into your app using Social Sign In. Pretty simple, right?</p><p>You can also add option to your Social Sign In process, but that depends of the provider you choose. For the Google provider, you can have all information in the documentation: <a href="https://firebase.google.com/docs/auth/web/google-signin">https://firebase.google.com/docs/auth/web/google-signin</a>.</p><h3>Other Social providers</h3><p>What if you need to add more social providers ? Well, with Firebase, it’s pretty much the same as we did for the Google provider. The only differences is that, first, when you will enable the provider in Firebase (beginning of step two), you will be required to add your API keys, and second, you’ll need to get back the corresponding <strong>provider </strong>(but don’t worry, Firebase have all the required methods for this).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fACmYgsevUj4QOYUdkbLng.png" /></figure><p>To have API keys, you generally need to create an app with the social provider you want to use. If you want for example to add Twitter Social Sign In, everything about how to get back API keys and create an app is explained in their documentation: <a href="https://developer.twitter.com/en/docs/basics/authentication/overview/oauth.html">https://developer.twitter.com/en/docs/basics/authentication/overview/oauth.html</a></p><p>Also, Firebase have a documentation page for each social provider (Twitter: <a href="https://firebase.google.com/docs/auth/web/twitter-login">https://firebase.google.com/docs/auth/web/twitter-login</a> for instance).</p><h3>The End</h3><p>We now have a small Vue app using Firebase authentication system, either with email/password or OAuth !</p><p>All the sources are available on Github in the social-sign-in branch: <a href="https://github.com/captainyouz/vue-firebase-tutorial/tree/social-sign-in">https://github.com/captainyouz/vue-firebase-tutorial/tree/social-sign-in</a>.</p><p>Anas.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=21f341bbf1b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Vue 2 + Firebase: How to build a Vue app with Firebase authentication system in 15 minutes]]></title>
            <link>https://medium.com/@anas.mammeri/vue-2-firebase-how-to-build-a-vue-app-with-firebase-authentication-system-in-15-minutes-fdce6f289c3c?source=rss-7acba3a309af------2</link>
            <guid isPermaLink="false">https://medium.com/p/fdce6f289c3c</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[vue-router]]></category>
            <category><![CDATA[firebaseauthentication]]></category>
            <category><![CDATA[firebase]]></category>
            <category><![CDATA[vuejs]]></category>
            <dc:creator><![CDATA[Anas Mammeri]]></dc:creator>
            <pubDate>Tue, 18 Jul 2017 13:23:52 GMT</pubDate>
            <atom:updated>2018-12-03T18:09:17.482Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/308/1*lNX4JPcG9ZBzWcG9qLVPBQ.png" /></figure><p>In this tutorial, we will see how to quickly build a web application with an authentication system using Vue 2, vue-router and Firebase.</p><blockquote><strong>10/11/2018: </strong>I’ve just updated this tutorial so it can be used with the awesome Vue Cli 3 and the latest version of Vue. All the sources of the previous version are still available in the Github repository (<a href="https://github.com/CaptainYouz/vue-firebase-tutorial">github.com/CaptainYouz/vue-firebase-tutorial</a>) before the ‘update-vue-cli` tag.</blockquote><h3><strong>What is Vue.js ?</strong></h3><p>Here is an overview of this amazing and lightweight javascript framework:</p><pre>Vue (pronounced /vjuː/, like <strong>view</strong>) is a <strong>progressive framework</strong> for building user interfaces. Unlike other monolithic frameworks, Vue is designed from the ground up to be incrementally adoptable. The core library is focused on the view layer only, and is very easy to pick up and integrate with other libraries or existing projects</pre><pre><em>from vuejs official documentation: </em><a href="https://vuejs.org/v2/guide"><em>https://vuejs.org/v2/guide</em></a></pre><h3><strong>Why Vue.js ?</strong></h3><p>Vue.js is very easy to use, powerful and well documented. In the age of new javascript frameworks that are component-driven, Vue stands out by his simplicity and his performance. The eco-system is vibrant, with more and more people switching to Vue every day.</p><p>If you want to go deeper in why you should use Vue.js, you can check this comparaison with other javascript framework: <a href="https://vuejs.org/v2/guide/comparison.html">https://vuejs.org/v2/guide/comparison.html</a></p><h3>What is Firebase ?</h3><pre><strong>Firebase</strong> is a mobile and web application development platform. Firebase is made up of complementary features that developers can mix-and-match to fit their needs. [...] Firebase&#39;s initial product was a realtime database, which provides an API that allows developers to store and sync data across multiple clients. Over time, it has expanded its product line to become a full suite for app development.</pre><pre><em>from wikipedia</em>: <a href="https://en.wikipedia.org/wiki/Firebase">https://en.wikipedia.org/wiki/Firebase</a></pre><p>In short terms, Firebase is a set of tools that allows you to develop an application without server-side programming. It has realtime database, authentication system, crash reporting, analytics and other services ready to use in your mobile/web app. That way, you can focus on your app and users.</p><h3>Why Firebase ?</h3><p>For application with minimal back-end needs such as authentication or database storage, no need to re-invent the wheel, Firebase does it for you, and gives you much more tools. Also, you don’t need to bother about scaling, server performance and database size, Firebase scales everything automatically.</p><h3>Let’s start !</h3><p>First, we are going to initialize a new Vue project by using the great tool <strong>Vue Cli 3</strong><em> (</em><a href="https://github.com/vuejs/vue-cli"><em>https://github.com/vuejs/vue-cli</em></a>).</p><p>If you don’t already have <strong>vue cli</strong> installed, let’s install it:</p><pre>$ npm install -g @vue/cli</pre><p>Now that you have <strong>vue cli</strong> installed, let’s create a new project. In vue cli documentation, it say’s:</p><pre><strong>Usage<br></strong>$ vue create &lt;project-name&gt;</pre><p>One of the cool features of <strong>Vue Cli 3</strong>, is that you can initialize your project with zero configuration required, so that you can start to code as fast as possible.</p><p>Let’s create our new Vue project and call it ‘<em>vue-firebase-tutorial’</em>.</p><pre>$ vue create vue-firebase-tutorial</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/508/1*bB-yBPJ94pQfCMVo0-d_mA.png" /><figcaption>vue create vue-firebase-tutorial</figcaption></figure><p>You will be prompted to pick a preset. You can either choose the default preset which comes with a basic Babel + ESLint setup, or select “<em>Manually select features</em>” to pick the features you need.</p><p>For our case, we are going to select “<em>Manually select features</em>” and choose <strong>vue-router </strong>option<strong> </strong>since we will be using it during this tutorial. For the other features, do as you want, as it won’t really matter for the rest of the tutorial.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/647/1*ZYxocmSiIJ49GCugt1FuLg.png" /><figcaption>choose ‘Router’ option</figcaption></figure><p>At the end, you will be asked if you want to save this preset for future projects and after that, your project will be initialized.</p><p>Then, enter the new <em>vue-firebase-tutorial</em> directory, and run npm run serve</p><pre>$ cd vue-firebase-tutorial<br>$ npm run serve</pre><p>Now, if you open the url ‘<strong><em>http://localhost:8080’</em></strong>, you should have the default view of our Vue project!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mfoLl9pG6JDlIF_TiEeceQ.png" /><figcaption>default view from the new Vue project</figcaption></figure><p><strong>The App Structure</strong></p><p>Let’s have a quick look of the app structure.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/262/1*Wsey2elyaRlZCd4qGDjpuA.png" /><figcaption>app structure</figcaption></figure><p>For this tutorial, we just need to know that our source code will be under the src/ directory.</p><p>The other files are mostly configuration files generated by Vue Cli 3. If you want to have a complete overview of the structure, you can check the Vue Cli 3 documentation.</p><p>Also, before going further in this tutorial, if you don’t already know the structure of a Vue file (like src/components/HelloWorld.vue), i advise you to take a look to this: <a href="https://vuejs.org/v2/guide/single-file-components.html">https://vuejs.org/v2/guide/single-file-components.html</a></p><h3><strong>LET’S WRITE SOME CODE !</strong></h3><p><strong>Our future App Architecture</strong></p><p>Our app will consist of three views, two (<em>Login</em> view and <em>Sign Up</em> view) that we can access only without authentication, and one (<em>Home</em> view) that we can access only with authentication.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/574/1*ML6JoSHSNBtRqKlVIz1qkQ.png" /><figcaption>app architecture</figcaption></figure><p>After login successfully or after a new account creation, we will be redirected to the authenticated part of the app, the <em>Home</em> view.</p><h3>Step One: Login and SignUp</h3><p><strong>1–1 The Login View</strong></p><p>Let’s create the <em>Login</em> view. To do so, we will create a new Vue component called <strong>Login </strong>under src/views</p><p>For the moment, the component will simply consist of a title, two input fields, a button and a small sentence in the html.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6QisIzjuKnhIgIa46IFxfQ.png" /><figcaption>Login component.`src/views/Login.vue`</figcaption></figure><p>Our component is now created! But how to display this new component in our app? Well, for that, we are going to use <strong>vue-router</strong><em>. </em>Remember? We already installed it when we initialized the app with <strong>vue-cli</strong><em>.</em></p><p>What is <strong>vue-router</strong> ?</p><pre>vue-router is the official router for <a href="http://vuejs.org/">Vue.js</a>. It deeply integrates with Vue.js core to make building Single Page Applications with Vue.js a breeze. </pre><pre>Creating a Single-page Application with Vue.js + vue-router is dead simple. With Vue.js, we are already composing our application with components. When adding vue-router to the mix, all we need to do is map our components to the routes and let vue-router know where to render them.</pre><pre>from vue-router documentation: <a href="https://github.com/vuejs/vue-router">https://github.com/vuejs/vue-route</a></pre><p>So, let’s add our new <strong>Login</strong><em> </em>component that we just created to our app router. Open the src/router.js file and add the <strong>Login</strong><em> </em>component to the router like that:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0QBkBqYof1Z2YfX0g5kJDA.png" /><figcaption>src/router.js</figcaption></figure><p>Then, if you change your browser url to localhost:8080/#/login you should see the new <strong>Login</strong><em> </em>component that we just created displayed in your browser:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*khG1iPvirigkpvJ9Vwxlkg.png" /><figcaption><a href="http://localhost:8080/#/login">http://localhost:8080/#/login</a></figcaption></figure><p>Why do we still have the default menu despite the fact that we didn’t put it in the html template of the <strong>Login</strong><em> </em>component? Well, if you open the App.vue file, the template of the <strong>App</strong> component is as follow:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3UgpBvxMJ2tYBCDqwoYDkw.png" /><figcaption>html template of App component</figcaption></figure><p>The <strong>App</strong> component is the main component of the app and will be the first to be rendered. It contains a div with two <strong>router-link</strong> elements and a html component called <strong>router-view</strong>.</p><p>We will soon talk about the <strong>router-link</strong> element, but first, let’s see what is the <strong>router-view </strong>element.</p><p><strong>Router-view</strong> is a component of <strong>vue-router</strong><em>:</em></p><pre>The &lt;router-view&gt; component is a functional component that renders the matched component for the given path. Components rendered in &lt;router-view&gt; can also contain its own &lt;router-view&gt;, which will render components for nested paths.</pre><pre>from vue-router documentation <a href="https://router.vuejs.org/en/api/router-view.html">https://router.vuejs.org/en/api/router-view.html</a></pre><p>So, when reaching <a href="http://localhost:8080/#/login">http://localhost:8080/#/login</a> <strong>vue-router</strong> will render the attached component of the path/login we defined in src/router.js inside the <strong>router-view</strong> component. And since the <strong>App </strong>component also contain the nav div with the two router-link elements in his template, we also have them display in our view.</p><p>To avoid confusion with the navigation of the app we are creating, let’s remove this nav div from the <strong>App</strong> component and replace it with the vue logo. We already have the Vue logo inside the src/assets/ directory, so let’s use it!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2omNt01QKlSb-CrrUmMUJQ.png" /><figcaption>App Component in `src/App.vue`</figcaption></figure><p>Also, Since we are not going to use the <em>About</em> view, we can remove the file from our directory (src/views/About.vue) and also remove i t from our routes configuration in src/router.js</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/904/1*jM9_uspe6uTCnmJ5zESBVA.png" /><figcaption>src/router.js</figcaption></figure><p>Now, let’s get back to our <em>Login </em>view add some style to our <strong>Login</strong> component.Inside the &lt;style&gt; element of your Login.vue file, add those styles.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mb1uKaUKAXFt1v3krkSMmw.png" /><figcaption>style of Login component</figcaption></figure><p>Now, the login page should be a little bit prettier.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*U7gRT1pWOSf66HbG1GMqTg.png" /><figcaption>Login view with css applied</figcaption></figure><p><strong>1-2- The Sign Up View</strong></p><p>The same way we created the <em>Login</em> view, we are going to create the <em>Sign Up</em> view.</p><p>For that, create a new vue component called <strong>SignUp </strong>under src/views/.</p><p>As for the <strong>Login </strong>component, the <strong>SignUp </strong>component will consist, for now, of a simple form and some style attached to it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_8oTvPH0cbMBssKcdO8Sfw.png" /><figcaption>src/views/SignUp.vue</figcaption></figure><p>Then, add the new component in our routes inside src/router.js</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hxW70hs2TnaXXGpeyjhpiA.png" /><figcaption>src/router.js</figcaption></figure><p>Then, if you open your browser to <a href="http://localhost:8080/#/sign-up%60">http://localhost:8080/#/sign-up</a>, you should have the following view:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OBhwk8k14i_GI90dhMjibw.png" /><figcaption>SignUp view</figcaption></figure><h3>Step Two: Navigation between views</h3><p>If we look back to the schema of the app architecture we defined, we can navigate from the <em>Login </em>view to the <em>SignUp </em>view, and from those two views to the <em>Home</em> view. How to do so?</p><p>Well, we will use another component of <strong>vue-router</strong><em> </em>that we quickly saw before,<em> </em>called <strong>router-link</strong>.</p><pre>&lt;router-link&gt; is the component for enabling user navigation in a router-enabled app. The target location is specified with the to prop. It renders as an &lt;a&gt; tag with correct href by default, but can be configured with the tag prop. In addition, the link automatically gets an active CSS class when the target route is active.</pre><pre>from vue-router documentation: <a href="https://router.vuejs.org/en/api/router-link.html">https://router.vuejs.org/en/api/router-link.html</a></pre><p>So, in the <strong>Login </strong>and <strong>SignUp </strong>component, let’s implement router-link so we can navigate between those two views.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sTTkyBT-BxFVTogz8P1W1A.png" /><figcaption>src/views/Login.vue</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*y-X5WNFhwtFrrHgWM9Z2eA.png" /><figcaption>src/views/SignUp.vue</figcaption></figure><p>Now, you should be able to navigate between the two pages by using the links we just created.</p><p>The last part of navigation will consist to go from <em>Login</em>/<em>SignUp </em>views to the <em>Home </em>view. For now, since we don’t have any code implemented, we will do a simple redirection to the <em>Home</em> view when clicking on the Connection button, without any authentication checking.</p><p>With router-link, the navigation take places in the html part of the component, but now, we want to navigate between routes programmatically. To do so, we need to attach an event when clicking on the Connection button, and with Vue 2, we can do that with the v-on directive or with the @ alias for v-on directive.</p><pre><strong>Listening to Events</strong></pre><pre>We can use the v-on directive to listen to DOM events and run some JavaScript when they’re triggered.</pre><pre>from Vue 2 doc: <a href="https://vuejs.org/v2/guide/events.html#Listening-to-Events">https://vuejs.org/v2/guide/events.html#Listening-to-Events</a></pre><p>The event we want to listen to is click. So, on the click event of the Connection button, we want to navigate to the <em>Hello </em>view.</p><p>To navigate programmatically between views, <strong>vue-router </strong>has a set of function we can use in our app. To know more about those functions, you take a look in their documentation <a href="https://router.vuejs.org/en/essentials/navigation.html">https://router.vuejs.org/en/essentials/navigation.html</a>.</p><p>In our example, we are going to use the replace function, because once the user is logged in, we want the <em>Hello </em>view as our starting route.</p><p>Let’s change our <strong>Login </strong>component to put this in place.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ovZRir4f4SwfHtHVaG5UPA.png" /><figcaption>src/views/Login.vue</figcaption></figure><p>You can see inside the login function that we have this.$router.replace(&#39;home&#39;)</p><p>Why do we access the router with this? If you take a look into the main.js file, you’ll see that the router object is injected to the Vue app. That way, we can easily access it in every components of the app.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ut6cNvSR_IZUsi5L_GoqcQ.png" /><figcaption>src/App.vue</figcaption></figure><p>Also, we change the navigation to home, but we don’t have any hello path yet.</p><p>The default path of the <strong>Home </strong>component was / on the app initialization, but now that we know that the <em>Home</em> view will be only accessible when user is authenticated, let’s change the route so that the <em>Home</em> view is accessible when reaching /home path.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9Zefph7R87zkVke6ldJQvg.png" /><figcaption>src/router.js</figcaption></figure><p>Now, back to our <em>Login </em>view, if you click on the Connection button, you’ll be redirect to the <em>Home</em> view ! You’ll see two Vue logo display. That’s normal ! Check the content of the <strong>HelloWorld </strong>component in src/components/HelloWorld.vue ;). Remove the image from the template of the <strong>HelloWorld</strong> component to avoid duplication of the Vue logo.</p><h3>Step Three: Firebase Integration</h3><p>Now that we have our front-end app ready, let’s implement Firbase so we can use it’s authentication system !</p><p><strong>3.1 Create a new project on Firebase</strong></p><p>To use Firebase, you first need to create a new project on the firebase console. If you don’t have any account created, create one, then go to <a href="http://console.firebase.google.com/">console.firebase.google.com</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qHucYgBWsCoOe2kTSFmi6w.png" /><figcaption>Firebase console</figcaption></figure><p>Click on Add project . Them you should have a popup to create a new project. Choose the name you want. I choose to call it vue-firebase-tutorial</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JwJ2V9glt0l7g9JsdIDNew.png" /><figcaption>Create a new project</figcaption></figure><p>Then, you should arrive on your project home page.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XEZ9DnG1rn0f2_gkw51epw.png" /><figcaption>project home page on Firebase</figcaption></figure><p>Congrats ! Your Firebase project is created. Now, to integrate it in our app, click on Add Firebase to your web app.</p><p>A popup with a code snippet should appear. Copy the code inside the second script balise. It should look like:</p><pre>// Initialize Firebase</pre><pre>let config = {<br>  apiKey: &quot;YOUR_API_KEY&quot;,<br>  authDomain: &quot;YOUR_PROJECT_ID.firebaseapp.com&quot;,<br>  databaseURL: &quot;https://YOUR_PROJECT_ID.firebaseio.com&quot;,<br>  projectId: &quot;YOUR_PROJECT_ID&quot;,<br>  storageBucket: &quot;YOUR_PROJECT_ID.appspot.com&quot;,<br>  messagingSenderId: &quot;YOUR_MESSAGING_SEND_ID&quot;<br>};</pre><pre>firebase.initializeApp(config);</pre><p>Now, let’s back to our vue project. We need to add the Firebase module to our project. To do so:</p><pre>$ npm install ——save firebase</pre><p>Once the installation is done, let’s import Firebase module to our app. Open the main.js file, and initialize Firebase with the configuration code we copied earlier.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UfnXF1u5GrODcx0H2RL-GQ.png" /><figcaption>src/main.js</figcaption></figure><p>For the simplicity of the tutorial, we put the Firebase configuration in main.js file, but on real production system, avoid to do that and put it in a specific configuration file. Also, you may see appear in the console some Firebase warnings about only importing the part of the SDK we actually use. In production, you should definitely do that! But again, to keep the simplicity of this tutorial, I skip this part.</p><p>We have everything ready now to create new users on Firebase !</p><p><strong>3.2 Create User on Firebase with the SignUp component</strong></p><p>Let’s go back to our <strong>SignUp</strong> component and implement what we need to create users on Firebase.</p><p>To create a new user, we will need to get back the email and the password typed in our form inside our component controller. To do so, we are going to use the v-model directive of Vue 2.</p><pre>You can use the v-model directive to create two-way data bindings on form input and textarea elements. It automatically picks the correct way to update the element based on the input type. Although a bit magical, v-model is essentially syntax sugar for updating data on user input events, plus special care for some edge cases.</pre><pre>from Vue 2 documentation: <a href="https://vuejs.org/v2/guide/forms.html">https://vuejs.org/v2/guide/forms.html</a></pre><p>Once we retrieved the email and the password of the new user we want to create, we are going to use the Firebase function called <strong>createUserWithEmailAndPassword.</strong></p><p>This Firebase function does exactly what the name says, it create a new user with an email and a password. You can know more about this function in the official Firebase documentation here: <a href="https://firebase.google.com/docs/reference/js/firebase.auth.Auth#createUserWithEmailAndPassword">https://firebase.google.com/docs/reference/js/firebase.auth.Auth#createUserWithEmailAndPassword</a></p><p>Let’s add all that in our <strong>SignUp </strong>component:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qHLzjNpR5f5Eb9adtreAFw.png" /><figcaption>src/views/SignUp.vue</figcaption></figure><p>The <strong>createUserWithEmailAndPassword </strong>function return a Firebase promise, with an onResolve and onReject callback. You can know more about the different type of Firebase promises here: (<a href="https://firebase.google.com/docs/reference/js/firebase.Promise">https://firebase.google.com/docs/reference/js/firebase.Promise</a>).</p><p>For the moment, we just display an alert to see the result of the function.</p><p>Let’s try to create a new user in the interface.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*p0v1mabqJM_hCeiTKy3-9A.png" /></figure><p>It’s not working ! Why ?</p><p>The error message says:</p><pre><em>The given sign-in provider is disabled for this Firebase project. Enable it in the Firebase console, under the sign-in method tab of the Auth section.</em></pre><p>To have the possibility to create new user, we should enable the sign-in provider of Firebase. Let’s go back to the Firebase console, on the project we created in step 3.1.</p><p>On the Authentication part, we have a tab named SIGN-IN METHOD</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cNpLs-mYmBWm2uD6DbdBvQ.png" /></figure><p>You just need to enable the Email/Password provider.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DFmNkGI07XYFxvKb8y7lBA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*o-o_z3V7dEDob8FWKrJKhA.png" /></figure><p>Then, let’s try again to create a new user in our Vue app.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bCSBw3-8w9vW2YossO_v6A.png" /></figure><p>It’s working now ! Congrats, you just created an new user in your Firebase project !</p><p>To be sure that everything was correct, we can take a look in the firebase console, under Authentication part and see the list of users. You should have the user you just created in the list !</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RCrvw3ynLQCcmesBDsrRSA.png" /></figure><p><strong>3.3 Login with the new user</strong></p><p>Now that we have a new user created, let’s try to login with this user ! (When you successfully create a new user on Firebase, it automatically sign in the user in to the application, but for this example, we are going to sign in again from the <em>Login</em> view)</p><p>Let’s go back to our <strong>Login </strong>component. We need to get back the email and the password of the user who try to login, and sign in this user into Firebase. This component will look like the <strong>SignUp</strong> component, but the change will be the function we will call. To sign in a user in Firebase, we are going to use the <strong>signInWithEmailAndPassword </strong>function provided by Firebase. It takes the email and password as parameters and return a Firebase promise.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ie5B23xKkbN25_EZ4SVQJw.png" /><figcaption>src/views/Login.vue</figcaption></figure><p>Now, let’s try to login with the user we just created</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5fuc5T1TIIAtLRNCNI7PQw.png" /></figure><p>It’s working ! Your user is now authenticated in Firebase !</p><h3>Step Four: Access the app only with authentication</h3><p><strong>4.1: Add meta fields to routes</strong></p><p>We are now authenticated! But nothing happen’s, right? Well, we need to redirect the user to the part of the application that can be accessed only if the user is authenticated. We already defined in our (beautiful) schema that the authenticated view of our app will be the <em>Home</em> view.</p><p>To implement that in our Vue application, we can use <strong>meta</strong> field of <strong>vue-router. </strong>A <strong>meta</strong> field is an additional information you can set to your route.</p><p>To know more about meta, you can check the vue-router documentation here: <a href="https://router.vuejs.org/en/advanced/meta.html">https://router.vuejs.org/en/advanced/meta.html</a></p><p>Let’s add a <strong>meta</strong> field to the <em>Home </em>view that we will use for this example. This <strong>meta </strong>will be called requiresAuth and will inform us that this view need authentication.</p><p>Also, now that we will have all our routes, we should define a default route for the app, since we changed the hello component that was before the default landing page.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*B9qFjYLQcqC1iydrT8j_Mw.png" /><figcaption>src/router.js</figcaption></figure><p>With path: ‘*’, we redirect every paths that does not exist to the <em>Login</em> view. If the user is authenticated, since the login page won’t be accessible when user is logged in, it will automatically redirect the view to the <em>Hello </em>view.</p><p>You can now try to enter a bad url, and you’ll see that it will redirect to the <em>Login</em> view.</p><p><strong>4.2: Redirect the routes if user is authenticated</strong></p><p>Now that we have everything ready, we need to know if the user is authenticated in Firebase. To do so, Firebase provides a function to get back the current user: <strong>firebase.auth().currentUser</strong></p><p>This function send back the currently signed-in user by using the currentUser property. If a user isn&#39;t signed in, currentUser is null.</p><p>In the previous part, we set <strong>meta</strong> fields to our routes, so that we could know which view need authentication to be accessible.</p><p>Now, we need to check before accessing each views if the user is authenticated and if the view we want to access need authentication or not.</p><p>To do so, we are going to use navigation guards of <strong>vue-router.</strong></p><pre>Navigation Guards</pre><pre>As the name suggests, the navigation guards provided by vue-router are primarily used to guard navigations either by redirecting it or canceling it. There are a number of ways to hook into the route navigation process: globally, per-route, or in-component.</pre><pre>from vue-router documentation: <a href="https://router.vuejs.org/en/advanced/navigation-guards.html">https://router.vuejs.org/en/advanced/navigation-guards.html</a></pre><p>In our example, we are going to use the global navigation guard beforeEach.</p><p>Let’s implement it in our src/router/index.js file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*inACApgeUbSo5OsuYb4cVA.png" /><figcaption>src/router.js</figcaption></figure><p>The beforeEach function take three parameters, to, from, and next and will be called whenever a navigation is triggered.</p><ul><li>to parameter is the target <a href="https://router.vuejs.org/en/api/route-object.html">Route Object</a> being navigated to.</li><li>from parameter is the current route being navigated away from.</li><li>next parameter is a function that must be called to resolve the hook, and can take argument to redirect or abort the navigation (see more on the <a href="https://router.vuejs.org/en/advanced/navigation-guards.html">documentation</a>)</li></ul><p>In the beforeEach function, we get back the currentUser of Firebase, and we check if the route we want to navigate to need authentication by checking if the route object has the <strong>requiresAuth meta.</strong></p><p>To understand the way we get back the <strong>requiresAuth meta, </strong>we need first to know that each route object in the routes configuration is called a route record. In our tutorial, we don’t have nested routes, but a route records may be nested. Therefore when a route is matched, it can potentially match more than one route record.</p><p>All route records matched by a route are exposed on the $route object (and also route objects in navigation guards) as the $route.matched Array. Therefore, we need to iterate over $route.matched to check for meta fields in route records.</p><p>So, in our navigation guard global function, inside the to route object, we search if the matched Array has some records (in our case a single one) with requiresAuth <strong>meta.</strong></p><p>Then, we defined our rules for navigation !</p><p>If the route we navigate to requires authentication and there is no current user logged in, we redirect to the <em>Login</em> view.</p><p>If the route we navigate to does not require authentication and there is a user logged in, we redirect to the <em>Home </em>view.</p><p>Else, we proceed navigation.</p><p>We should now be able to access the app only when the user is authenticated !</p><p>Since we already logged-in in the previous step, if you reload the page, based on our navigation guard implementation, you should be redirect to the <em>Hello</em> view.</p><p>Let’s try to reload the page.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*U7gRT1pWOSf66HbG1GMqTg.png" /></figure><p>Nothing is happening ! We still are in the <em>Login</em> view.</p><p>Why ?</p><p>Well, it’s simply because in the lifecycle of our app, the execution of our navigation guard <strong>beforeEach</strong> take place before Firebase initialization end. So, when we first load the app, since Firebase module has not finish his initialization, <strong>firebase.auth().currentUser</strong> return null!</p><p>After the first load, if you try to go to the sign-up view, you’ll see that the redirection take place and you ends up in the <em>Hello</em> view.</p><p>How can we avoid this scenario and make sure that the redirection take place directly on the first load of the app?</p><p>Well, Firebase let’s us the possibility to set an observer on the <strong>Auth</strong> object, so we can ensure that the Auth object isn’t in an intermediate state — such as initialization — when you get the current user.</p><p>This observer is called <strong>onAuthStateChanged. </strong>(you can see more about the observer in the Firebase documentation: <a href="https://firebase.google.com/docs/auth/web/manage-users#get_a_users_profile">https://firebase.google.com/docs/auth/web/manage-users#get_a_users_profile</a>)</p><p>So, by setting a callback on the <strong>onAuthStateChanged </strong>observer, we can initialize the Vue app only when we are sure Firebase is initialized.</p><p>Let’s change our src/main.js file like that:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*a6uMGmM45Grz0NC2M7jlmQ.png" /><figcaption>src/main.js</figcaption></figure><p>We now initialize the app only when we are sure Firebase Auth object is ready to use.</p><p>Now if you refresh the page, or try to access the <em>Login</em> or <em>SignUp </em>view from url, you’ll see the redirection in action !</p><p><strong>4.3: Redirection after Login/SignUp and logout from the app</strong></p><p>Now that we have our authentication system, we still need to redirect the user after the Login or when a new user is created. Also, we want to be able to logout from Firebase.</p><p>To logout, let’s just add a button in our <strong>Home </strong>component and attached an event to logout from Firebase.</p><p>Like <strong>signInWithEmailAndPassword </strong>and <strong>createUserWithEmailAndPassword, </strong>Firebase provide a function to logout called <strong>signOut </strong>that return a promise<strong>. </strong>Once the <strong>SignOut </strong>function is done, we will redirect the app to the <em>Login</em> view.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OJM5AxXKJTTDj-DarfXUWQ.png" /><figcaption>src/views/Home.vue</figcaption></figure><p>Now, when we click on the button, we logout from Firebase and go back on the <em>Login</em> view.</p><p>To be sure that you are now logout from Firebase, you can refresh the page or try to access the <em>Home</em> view.</p><p>Now, let’s sign in again, but before that, let’s change the code so that we can be redirect to the authenticate part of the app after login.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QV0GwzC-7xb22ZDXDaxwlg.png" /><figcaption>src/Login.vue</figcaption></figure><p>Now, try to login, and you should be redirect to the <em>Home</em> view.</p><p>Let’s implement the same thing for the <strong>SignUp</strong> component.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GS5HngxviTEaaZPZuvbDTg.png" /><figcaption>src/views/SignUp.vue</figcaption></figure><p>Now, after a new account creation, the user will also be redirect to the <em>Home</em> view !</p><p>You may noticed that i turned the callback functions in <strong>signInWithEmailAndPassword, createUserWithEmailAndPassword, </strong>and <strong>signOut </strong>in ES6 arrow functions. Why ?</p><p>Simply because method definition (function name() {}), have their own this context. If we were using method definition, we wouldn’t be able to access this.$router inside our callbacks. We should have encapsulate the this object of the parent method inside a variable to access it.</p><p>With ES6 arrow function, this is lexical, meaning that it does not create its own this context. Instead, this has the original meaning from the enclosing context.</p><p>By using ES6 arrow function, we can access this.$router and let the redirection take place.</p><h3><strong>The End</strong></h3><p>We now have a small Vue app using Firebase authentication system!</p><p>All the sources are available on Github: <a href="https://github.com/CaptainYouz/vue-firebase-tutorial">github.com/CaptainYouz/vue-firebase-tutorial</a>.</p><p>And, if you want to know how to implement the <strong>Social Sign In</strong> feature of Firebase, you can <a href="https://medium.com/@anas.mammeri/vue-2-firebase-how-to-add-firebase-social-sign-in-into-your-vue-application-21f341bbf1b">check out the part II of this tutorial</a>! ;)</p><p><strong>Update — September 2018 — — — —</strong></p><p>Hi everyone!</p><p>A little bit more than one year ago, I released this tutorial, and I really didn’t expect it to be so much read and used. I wrote it as a side project, without any real plan for it.</p><p>But today, I would like to continue this project and make it the first one of a series of tutorials for Vue.js and Firebase. So, if you have any thoughts or ideas, I would love to hear them from you!</p><p>Anas.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fdce6f289c3c" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>