Company
Date Published
April 19, 2021
Author
Martyn Davies
Word count
3017
Language
English
Hacker News points
None

Summary

This tutorial provides a comprehensive guide to building a basic application with two-factor authentication using the Nuxt JS framework. The application requires users to verify themselves by entering a PIN code sent to them via SMS, and it uses the Nexmo Verify API for this purpose. To achieve this, the tutorial demonstrates how to create a mini verification API using Express middleware inside Nuxt, which exposes three endpoints: `/send`, `/verify`, and `/auth-check`. These endpoints handle user input, verify phone numbers, and check authentication status, respectively. The application also includes server-side rendering, custom server middleware, and VueX state management. The tutorial concludes by highlighting the benefits of using Nuxt's Server Side Middleware for building complex applications with minimal overhead.