Full-Stack Web Development with Vue.js and Node

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

That's it. Now, let's navigate to http://localhost.com:8080/users/login:


Adding submit and clear methods to the login form


The next step is to add functionality in the submit and clear methods. Let's add some


methods to Login.vue. The clear method is the same as on the register page. For the


submit method, we will use the axios method here. We have already categorized our


success and error messages in the controller. Now we just need to make sure that they are


displayed in the UI:


...
</v-form>
</template>
<script>
import axios from 'axios';

export default {
data: () => ({
valid: true,
Free download pdf