Skip to content

Commit

Permalink
chore: disable auth on cart andpoints
Browse files Browse the repository at this point in the history
  • Loading branch information
lifter21 committed Dec 2, 2020
1 parent 4a6e65d commit 2f55f7e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/app.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export class AppController {

constructor(private authService: AuthService) {}

@Get('ping')
@Get([ '', 'ping' ])
healthCheck(): any {
return {
statusCode: HttpStatus.OK,
Expand Down
10 changes: 5 additions & 5 deletions src/cart/cart.controller.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Controller, Get, Delete, Put, Body, Req, Post, UseGuards, HttpStatus } from '@nestjs/common';

import { BasicAuthGuard, JwtAuthGuard } from '../auth';
// import { BasicAuthGuard, JwtAuthGuard } from '../auth';
import { OrderService } from '../order';
import { AppRequest, getUserIdFromRequest } from '../shared';

Expand All @@ -15,7 +15,7 @@ export class CartController {
) { }

// @UseGuards(JwtAuthGuard)
@UseGuards(BasicAuthGuard)
// @UseGuards(BasicAuthGuard)
@Get()
findUserCart(@Req() req: AppRequest) {
const cart = this.cartService.findOrCreateByUserId(getUserIdFromRequest(req));
Expand All @@ -28,7 +28,7 @@ export class CartController {
}

// @UseGuards(JwtAuthGuard)
@UseGuards(BasicAuthGuard)
// @UseGuards(BasicAuthGuard)
@Put()
updateUserCart(@Req() req: AppRequest, @Body() body) { // TODO: validate body payload...
const cart = this.cartService.updateByUserId(getUserIdFromRequest(req), body)
Expand All @@ -44,7 +44,7 @@ export class CartController {
}

// @UseGuards(JwtAuthGuard)
@UseGuards(BasicAuthGuard)
// @UseGuards(BasicAuthGuard)
@Delete()
clearUserCart(@Req() req: AppRequest) {
this.cartService.removeByUserId(getUserIdFromRequest(req));
Expand All @@ -56,7 +56,7 @@ export class CartController {
}

// @UseGuards(JwtAuthGuard)
@UseGuards(BasicAuthGuard)
// @UseGuards(BasicAuthGuard)
@Post('checkout')
checkout(@Req() req: AppRequest, @Body() body) {
const userId = getUserIdFromRequest(req);
Expand Down

0 comments on commit 2f55f7e

Please sign in to comment.