Code Monkey home page Code Monkey logo

nest-commerce's Introduction

Nest Logo

A progressive Node.js framework for building efficient and scalable server-side applications, heavily inspired by Angular.

NPM Version Package License NPM Downloads Travis Linux Coverage Gitter Backers on Open Collective Sponsors on Open Collective

Project Description

E-Commerce web application

Project Learning Goals

  • Role Based Authentication
  • NoSQL Database, probably MongoDB
  • Explore testing
  • Explore Deployment/DevOPs
  • React/Redux frontend in TypeScript
  • React Hooks
  • SSR with NextJS ?

nest-commerce's People

Contributors

gilliangoud avatar kelvin-mai 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  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  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

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

nest-commerce's Issues

Jwt is not authorizing any user for any route.

Dear Kelvin,

First at all, thanks so much for all the time and effort you are putting into your Nestjs Series.
I have studied your "Ideas App" series as well as the "nest-commerce" tutorial.

I got seriously stuck in video 6 about Authorization, and after 7 days breaking my head, searching for solutions in Google, Nest Docs, Stackflow and your Github code I decided to contact you for help.

I hope you can take a look into my issue.

I am able to Register and Login any user but I am not able to authorize any route.
When I reproduce the issue I get:
code: 401
message: Unauthorized

After isolating every line, the problem is at @UseGuards(AuthGuard('jwt'))

The code varies from yours because instead of Mongo, I used MySQL
I also set up the directories a little different but mostly I followed your guidelines.

Here is a repo I just built for your convenience:
https://github.com/Domiserver/kmcommerce

Thanks again.
Ron
PS: The .etl, ormconfig.json and .env files are ignored in the repo. If you need them, let me know to upload them.

Update User Decorator

In file utilities/user.decorator.ts

change the code :
export const User = createParamDecorator((data, req) => req.user);

to:

export const User = createParamDecorator((data, ctx: ExecutionContext) => {
  const req = ctx.switchToHttp().getRequest();
  return req.user;
});

user.depopulate('password') is invalid

'password' still return when login or register, but it work in your video.

my project dependencies:

"@nestjs/mongoose": "^6.1.2"
"mongoose": "^5.5.5"

mongodb version: v4.0.2

I clone this project, but it didn't work.

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.