Giter Site home page Giter Site logo

Add login / authentication example about nuxt.js HOT 5 CLOSED

nuxt avatar nuxt commented on April 28, 2024 5
Add login / authentication example

from nuxt.js.

Comments (5)

Atinux avatar Atinux commented on April 28, 2024 1

Hi @niallobrien

Thank you for using nuxt.js in it's alpha stage, it's already planned in nuxt.js: https://github.com/nuxt/nuxt.js/projects/1

It will be easier to do with nuxt.js since you can use it as a middleware in express, adonis, etc.

Also, nuxt.js is configurable with a nuxt.config.js file instead of next.js

from nuxt.js.

Atinux avatar Atinux commented on April 28, 2024

Hi @niallobrien

You can see an example here: https://nuxtjs.org/examples/auth-routes

And the live demo on https://auth-routes.nuxtjs.org/

from nuxt.js.

vaggelis2018 avatar vaggelis2018 commented on April 28, 2024

@Atinux what if we have a token which expires? I create a middleware on server which refreshes the token if it has been expired and update the session but vuex isn't refreshed with the new token.

from nuxt.js.

awronski avatar awronski commented on April 28, 2024

@vaggelis2018 you can check in client middleware if the token was refreshed on the server.
and if so update the client store state.

client middleware :

export default function ({ store }) {
   // check if server refreshed the token and retrive it
 store.dispatch('refreshToken', token)
}

from nuxt.js.

lock avatar lock commented on April 28, 2024

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

from nuxt.js.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.