Giter Site home page Giter Site logo

nuxt-auth-from-scratch's Introduction

nuxt-auth-from-scratch's People

Contributors

kasheftin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

nuxt-auth-from-scratch's Issues

Endless loop on logout

Hi have you try to use logout functionality, because I have some problems with that.
When I dispatching me.$store.dispatch("auth/reset") I ended up with endless loop inside auth midleware on line
return redirect("/login");
Can you please give me any hints what the problem it could be?

Token required on post

So I have created a post.vue page where I can submit text and title to the server. I am getting 500 response which indicates I am not providing token to the post request.

If I remove the need for a token on server side, I successfully post and create a new record in the db.

I have tried everything to submit with the header and auth token however now I am without the ideas of what to do in order to resolve this issue.

Any ideas / help please?

edit: This page is available only to already logged in users.

Thanks

token is lost after refresh

Since my back end expects Authorization Bearer token, I changed x-access-token to Authorization. Everything works fine but on refresh, token is lost and it logs me out.

What am I missing?

Help, please! :)

nuxtServerInit resolving true before api.auth.me() promise returned

Hey @Kasheftin thanks for this guide, it is absolutely awesome.

I've found a bug (maybe it's not?) where full page reloads within admin are causing this line:

const userIsLoggedIn = !!store.state.auth.user

to evaluate to false.

The problem seems to be that this line:


is returning before the api.auth.me() promise is resolved here:
commit('set_user', response.data.result)

Consequence is that commit('set_user', response.data.result) is never committed and const userIsLoggedIn = !!store.state.auth.user becomes false.

What are your thoughts?

Docker Access to XMLHttpRequest at '' has been blocked by CORS policy

Hi and first, thank you for your tutorial.
I try to dockerize your app and I am stuck with this error:
XMLHttpRequest at '' has been blocked by CORS policy when I click on login
I have 4 containers:

  • Frontend (nuxt)
  • Backend (node)
  • Database
  • nginx proxy

run with docker-compose

I modified slightly your code by adding npm cors package to allow cors in backend/server.js

var corsOptions = {
 "origin": "*",
 "methods": "GET,HEAD,PUT,PATCH,POST,DELETE",
 "allowedHeaders": ['Content-Type, Content-Length, x-access-token'],
 "preflightContinue": true,
 "optionsSuccessStatus": 204
}
const app = express()
app.use(cors(corsOptions))

with no success.
Any idea

Please fix typo

Please change
error.response.data.message || error.reponse.status
to
error.response.data.message || error.response.status

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.