diff --git a/package-lock.json b/package-lock.json index f582e3c..6f57884 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,14 +1,15 @@ { "name": "@apihub24/password-hasher", - "version": "1.0.8", + "version": "1.0.9", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@apihub24/password-hasher", - "version": "1.0.8", + "version": "1.0.9", "license": "MIT", "dependencies": { + "@apihub24/authentication": "^1.0.1", "@apihub24/token-authentication": "^1.0.4", "@nestjs/common": "^11.1.6", "@nestjs/config": "^4.0.2", @@ -37,6 +38,12 @@ "node": ">=6.0.0" } }, + "node_modules/@apihub24/authentication": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@apihub24/authentication/-/authentication-1.0.1.tgz", + "integrity": "sha512-nWw75ofQKHxE0dI7PzvNBQNcQrX/HSrzuAJTYNu42BoCROba1NUz8QAodTn5+3dIeQEzw127gtSb6D7yW0B8Jg==", + "license": "MIT" + }, "node_modules/@apihub24/repository": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/@apihub24/repository/-/repository-1.0.3.tgz", diff --git a/package.json b/package.json index ea87d28..6dbdfc6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@apihub24/password-hasher", - "version": "1.0.8", + "version": "1.0.9", "description": "", "main": "dist/index.js", "types": "./dist/index.d.ts", @@ -14,7 +14,7 @@ "dependencies": { "@nestjs/common": "^11.1.6", "@nestjs/config": "^4.0.2", - "@apihub24/token-authentication": "^1.0.4", + "@apihub24/authentication": "^1.0.1", "bcrypt": "^6.0.0" }, "devDependencies": { diff --git a/src/password.hash.service.ts b/src/password.hash.service.ts index 62471fb..cd76eda 100644 --- a/src/password.hash.service.ts +++ b/src/password.hash.service.ts @@ -1,4 +1,4 @@ -import { IPasswordService } from "@apihub24/token-authentication"; +import { IPasswordService } from "@apihub24/authentication"; import { Inject, Injectable } from "@nestjs/common"; import { ConfigService } from "@nestjs/config"; import bcrypt from "bcrypt"; diff --git a/src/password.hasher.module.spec.ts b/src/password.hasher.module.spec.ts index d4de461..75ec03f 100644 --- a/src/password.hasher.module.spec.ts +++ b/src/password.hasher.module.spec.ts @@ -1,8 +1,5 @@ import { Test, TestingModule } from "@nestjs/testing"; -import { - APIHUB24_PASSWORD_SERVICE_INJECTION_KEY, - PasswordHasherModule, -} from "./"; +import { PasswordHasherModule } from "./"; describe("PasswordHasherModule Tests", () => { let module: TestingModule | null = null; @@ -13,10 +10,6 @@ describe("PasswordHasherModule Tests", () => { }).compile(); }); - it("should export injection Key", () => { - expect(APIHUB24_PASSWORD_SERVICE_INJECTION_KEY).toBeDefined(); - }); - it("should get PasswordHasherService by injection Key @apihub24/password_service", () => { expect(module).toBeDefined(); const service = module?.get("@apihub24/password_service"); diff --git a/src/password.hasher.module.ts b/src/password.hasher.module.ts index 757c290..9d5e756 100644 --- a/src/password.hasher.module.ts +++ b/src/password.hasher.module.ts @@ -1,9 +1,7 @@ import { DynamicModule, Global, Module } from "@nestjs/common"; import { PasswordHashService } from "./password.hash.service"; import { ConfigModule } from "@nestjs/config"; - -export const APIHUB24_PASSWORD_SERVICE_INJECTION_KEY = - "@apihub24/password_service"; +import { APIHUB24_PASSWORD_SERVICE } from "@apihub24/authentication"; @Global() @Module({}) @@ -11,7 +9,7 @@ export class PasswordHasherModule { static forRoot(): DynamicModule { const providers = [ { - provide: APIHUB24_PASSWORD_SERVICE_INJECTION_KEY, + provide: APIHUB24_PASSWORD_SERVICE, useClass: PasswordHashService, }, ];