Full-Stack Web Development with Vue.js and Node

(singke) #1
Building Authentication with passport.js Chapter 6

},
};
</script>

Here we are emitting a method called refreshUser which will be defined in the App.vue.


Replace the contents inside App.vue with the following code:


<template>
<v-app id="inspire">
<v-navigation-drawer
fixed
v-model="drawer"
app
>
<v-list dense>
<router-link v-bind:to="{ name: 'Home' }" class="side_bar_link">
<v-list-tile>
<v-list-tile-action>
<v-icon>home</v-icon>
</v-list-tile-action>
<v-list-tile-content>Home</v-list-tile-content>
</v-list-tile>
</router-link>
<router-link v-bind:to="{ name: 'Contact' }" class="side_bar_link">
<v-list-tile>
<v-list-tile-action>
<v-icon>contact_mail</v-icon>
</v-list-tile-action>
<v-list-tile-content>Contact</v-list-tile-content>
</v-list-tile>
</router-link>
</v-list>
</v-navigation-drawer>
<v-toolbar color="indigo" dark fixed app>
<v-toolbar-side-icon @click.stop="drawer = !drawer"></v-toolbar-side-
icon>
<v-toolbar-title>Home</v-toolbar-title>
<v-spacer></v-spacer>
<v-toolbar-items class="hidden-sm-and-down">
<v-btn id="add_movie_link" flat v-bind:to="{ name: 'AddMovie' }"
v-if="current_user">
Add Movie
</v-btn>
<v-btn id="user_email" flat v-if="current_user">{{
current_user.email }}</v-btn>
<v-btn flat v-bind:to="{ name: 'Register' }" v-if="!current_user"
id="register_btn">
Free download pdf