From the course: Angular: Cloud-Powered Apps with Firebase

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

User logout

User logout

From the course: Angular: Cloud-Powered Apps with Firebase

Start my 1-month free trial

User logout

- [Instructor] We are now displaying the current user, but we need the ability to logout the user. Let's head first to the app component which holds the header, and add a button for the logout action. Button here of class="ui secondary button and then logout, and we'll add a click handler, that will call the logout method on a component. In here, the text for the button will be Logout. Let's go ahead and add some css to position it to the far right. The logout button will be float right, relatively positioned, and we'll adjust the position slightly. Heading over to the application, we now see the Logout button there. Let's head back to the component now and implement the logout method. Instead of injecting again the AngularFireAuth service, let's create our own wrapper authentication service in order to encapsulate some common logic. For example, in a logout action, we will need to logout using the firebase service,…

Contents