@amplication/plugin-auth-jwt
Advanced tools
Comparing version 1.4.5 to 1.4.6
@@ -23,3 +23,3 @@ import { UnauthorizedException } from "@nestjs/common"; | ||
const { username } = payload; | ||
const user = await this.ENTITY_SERVICE.findOne({ | ||
const user = await this.ENTITY_SERVICE.FIND_ONE_FUNCTION({ | ||
where: { username }, | ||
@@ -26,0 +26,0 @@ }); |
@@ -11,7 +11,7 @@ import { UnauthorizedException } from "@nestjs/common"; | ||
beforeEach(() => { | ||
userService.findOne.mockClear(); | ||
userService.FIND_ONE_FUNCTION.mockClear(); | ||
}); | ||
it("should throw UnauthorizedException where there is no user", async () => { | ||
//ARRANGE | ||
userService.findOne | ||
userService.FIND_ONE_FUNCTION | ||
.calledWith({ where: { username: TEST_USER.username } }) | ||
@@ -18,0 +18,0 @@ .mockReturnValue(Promise.resolve(null)); |
{ | ||
"name": "@amplication/plugin-auth-jwt", | ||
"version": "1.4.5", | ||
"version": "1.4.6", | ||
"description": "set jwt as provider for Amplication build", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -19,2 +19,3 @@ import { Module, DsgContext } from "@amplication/code-gen-types"; | ||
import { print } from "@amplication/code-gen-utils"; | ||
import { camelCase } from "lodash"; | ||
@@ -80,2 +81,3 @@ const jwtStrategyBasePath = join( | ||
ENTITY_SERVICE: builders.identifier(`${entityNameToLower}Service`), | ||
FIND_ONE_FUNCTION: builders.identifier(`${camelCase(authEntity?.name) }`) | ||
}; | ||
@@ -82,0 +84,0 @@ |
@@ -17,2 +17,3 @@ import { Module, DsgContext } from "@amplication/code-gen-types"; | ||
import { print } from "@amplication/code-gen-utils"; | ||
import { camelCase } from "lodash"; | ||
@@ -69,2 +70,3 @@ const jwtStrategySpecPath = join( | ||
ENTITY_SERVICE: builders.identifier(`${entityServiceName}`), | ||
FIND_ONE_FUNCTION: builders.identifier(`${camelCase(authEntity?.name) }`) | ||
}; | ||
@@ -71,0 +73,0 @@ |
@@ -23,3 +23,3 @@ import { UnauthorizedException } from "@nestjs/common"; | ||
const { username } = payload; | ||
const user = await this.ENTITY_SERVICE.findOne({ | ||
const user = await this.ENTITY_SERVICE.FIND_ONE_FUNCTION({ | ||
where: { username }, | ||
@@ -26,0 +26,0 @@ }); |
@@ -11,7 +11,7 @@ import { UnauthorizedException } from "@nestjs/common"; | ||
beforeEach(() => { | ||
userService.findOne.mockClear(); | ||
userService.FIND_ONE_FUNCTION.mockClear(); | ||
}); | ||
it("should throw UnauthorizedException where there is no user", async () => { | ||
//ARRANGE | ||
userService.findOne | ||
userService.FIND_ONE_FUNCTION | ||
.calledWith({ where: { username: TEST_USER.username } }) | ||
@@ -18,0 +18,0 @@ .mockReturnValue(Promise.resolve(null)); |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
3163350
39359