Skip to content

Nuxt Sanctum Authentication

Introduction

The nuxt-sanctum-authentication module seamlessly integrates Laravel Sanctum with Nuxt 3 to provide a simple and secure authentication process for your application. It works efficiently in both Server-Side Rendering (SSR) and Client-Side Rendering (CSR) environments, ensuring consistent and reliable authentication regardless of how your app is rendered.

Key features

  • Seamless CSR and SSR Support: Works smoothly in both client-side and server-side rendering modes.
  • Automatic CSRF Token Management: Automatically handles CSRF tokens to protect your app from cross-site request forgery attacks.
  • Bearer Token Management: Manages Bearer tokens for secure access to protected resources.
  • Integration with Nuxt's ofetch Client: Fully compatible with Nuxt's ofetch client for making authenticated HTTP requests in your application.

NOTE

Before using this module, ensure that Laravel Sanctum is correctly configured on your backend. For more detailed setup instructions, refer to the Laravel Sanctum documentation.

Video Tutorial

Watch the step-by-step guide on how to use the nuxt-sanctum-authentication module in this Video Tutorial.

Nuxt Sanctum Authentication with Laravel Sanctum

Demo Repository

To explore the source code, check out the Nuxt Sanctum Authentication Demo Repository.

  • For Cookie-Based SPA Authentication, see the main branch.
  • For API Token Authentication, check out the api-token-authentication branch.

Support

If you find value in this module, please show your support for the project. Your contribution will help me to continually enhance and maintain it!

Ctrl+Alt+Cheat - The Ultimate Cheat Sheets at Your Fingertips

Ctrl+Alt+Cheat - The Ultimate Cheat Sheets at Your Fingertips

Boost your coding productivity with Ctrl+Alt+Cheat, a powerful VSCode extension that offers instant access to an extensive collection of cheat sheets for various programming languages and tools. Whether you're coding in PHP, JavaScript, Vue, React, Laravel, or dealing with Docker, MySQL, and more, this extension is your go-to resource.

Spec Coder: AI Powered VS Code Extension

Spec Coder: AI Powered VS Code Extension

Transform your Visual Studio Code experience with Spec Coder, the AI-driven extension that acts as your intelligent coding assistant. Choose from industry-leading AI providers like OpenAI, Gemini Pro, Hugging Face, and Ollama, and enhance your coding efficiency with powerful features tailored to your needs.

JavaScript: A Comprehensive Guide from ES2015 to ES2023 - eBook

JavaScript: A Comprehensive Guide from ES2015 to ES2023 - eBook

Stay ahead in the ever-evolving world of JavaScript with this comprehensive guide. Covering every major update from ES2015 to ES2023, this eBook is an invaluable resource for developers looking to master modern JavaScript features, optimize their code, and adopt best practices.