Is it possible to check if a user is authenticated before accessing page?

This page summarizes the projects mentioned and recommended in the original post on /r/Nuxt

SurveyJS - Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App
With SurveyJS form UI libraries, you can build and style forms in a fully-integrated drag & drop form builder, render them in your JS app, and store form submission data in any backend, inc. PHP, ASP.NET Core, and Node.js.
surveyjs.io
featured
InfluxDB - Power Real-Time Data Analytics at Scale
Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
www.influxdata.com
featured
  • Nuxt.js

    Discontinued Nuxt is an intuitive and extendable way to create type-safe, performant and production-grade full-stack web apps and websites with Vue 3. [Moved to: https://github.com/nuxt/nuxt]

  • Your user hits the refresh button on his/her browser. This turns into a server-side process called process.server on the endpoint "/profile" - reloading the browser tab should reset everything, so this possibly puts the user in an "unauthenticated state" - with the exception that your browser still having the cookie set. Then, all go through the rendering process again by calling the middleware (which can and should access this cookie) and setting the axios headers correctly. Run through asyncData() again, check that auth is set, then the user can see his/her profile page again.

    Also, someone created a package to read both client and server cookies you should look into.

  • SurveyJS

    Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App. With SurveyJS form UI libraries, you can build and style forms in a fully-integrated drag & drop form builder, render them in your JS app, and store form submission data in any backend, inc. PHP, ASP.NET Core, and Node.js.

    SurveyJS logo
  • auth-module

    Zero-boilerplate authentication support for Nuxt 2

  • I think the others have already answered your question for you, I just wanted to add that you might want to look into nuxt-auth which handles authentication on frontend and it sets up all the necessary middleware to do what you need.

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts

  • Working With Sitemaps in Nuxt.js

    3 projects | dev.to | 28 Sep 2021
  • Using Nuxt Content: Working with Remote Markdown Files

    8 projects | dev.to | 15 Apr 2024
  • Getting Started with Nuxt 3

    5 projects | dev.to | 9 Feb 2024
  • A composable that requires access to the Nuxt instance was called outside of a plugin, Nuxt hook, Nuxt middleware, or Vue setup function.

    1 project | /r/Nuxt | 13 Jul 2023
  • nuxt 3 stack for fullstack

    5 projects | /r/Nuxt | 16 May 2023