Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add login / authentication example #4

Closed
niallobrien opened this issue Nov 16, 2016 · 5 comments
Closed

Add login / authentication example #4

niallobrien opened this issue Nov 16, 2016 · 5 comments

Comments

@niallobrien
Copy link

niallobrien commented Nov 16, 2016

Hi, I think a lot of issues faced by Next.js apply to Nuxt.js also, and I believe that ultimately, such a feature will require a way to allow for custom server workflows, with session support etc.
Interested to discuss this.

vercel/next.js#153

This question is available on Nuxt.js community (#c12)
@Atinux
Copy link
Member

Atinux commented Nov 16, 2016

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

@Atinux Atinux added this to the 1.0 milestone Nov 21, 2016
@Atinux Atinux self-assigned this Nov 21, 2016
@Atinux
Copy link
Member

Atinux commented Dec 8, 2016

Hi @niallobrien

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

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

@Atinux Atinux closed this as completed Dec 8, 2016
@vaggelis2018
Copy link

vaggelis2018 commented Feb 7, 2018

@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.

@awronski
Copy link

awronski commented Feb 8, 2018

@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)
}

@lock
Copy link

lock bot commented Nov 5, 2018

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.

@lock lock bot locked as resolved and limited conversation to collaborators Nov 5, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants