parent
036a220276
commit
ffba4bdf09
@ -0,0 +1,2 @@ |
|||||||
|
node_modules |
||||||
|
dist |
@ -1,4 +1,8 @@ |
|||||||
{ |
{ |
||||||
"singleQuote": true, |
"singleQuote": true, |
||||||
"trailingComma": "all" |
"semi": true, |
||||||
} |
"tabWidth": 2, |
||||||
|
"trailingComma": "all", |
||||||
|
"printWidth": 100, |
||||||
|
"endOfLine": "auto" |
||||||
|
} |
||||||
|
@ -1 +1 @@ |
|||||||
{"version":3,"file":"app.module.js","sourceRoot":"","sources":["../src/app.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAwC;AACxC,qDAAiD;AACjD,+CAA2C;AAC3C,2CAA6D;AAC7D,6CAAgD;AAChD,+BAA4B;AAC5B,oDAAgD;AAChD,uDAAmD;AACnD,qCAAyC;AAyBlC,IAAM,SAAS,GAAf,MAAM,SAAS;CAAG,CAAA;AAAZ,8BAAS;oBAAT,SAAS;IAvBrB,IAAA,eAAM,EAAC;QACN,OAAO,EAAE;YACL,qBAAY,CAAC,OAAO,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;YACxC,uBAAa,CAAC,YAAY,CAAC;gBAC3B,OAAO,EAAE,CAAC,qBAAY,CAAC;gBACvB,MAAM,EAAE,CAAC,sBAAa,CAAC;gBACvB,UAAU,EAAE,KAAK,EAAE,MAAqB,EAAE,EAAE,CAAC,CAAC;oBAC5C,IAAI,EAAE,OAAO;oBACb,IAAI,EAAE,MAAM,CAAC,GAAG,CAAS,SAAS,CAAC;oBACnC,IAAI,EAAE,QAAQ,CAAC,MAAM,CAAC,GAAG,CAAS,SAAS,EAAE,MAAM,CAAC,EAAE,EAAE,CAAC;oBACzD,QAAQ,EAAE,MAAM,CAAC,GAAG,CAAS,aAAa,CAAC;oBAC3C,QAAQ,EAAE,MAAM,CAAC,GAAG,CAAS,aAAa,CAAC;oBAC3C,QAAQ,EAAE,MAAM,CAAC,GAAG,CAAS,aAAa,CAAC;oBAC3C,QAAQ,EAA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AAI,CAAC,OAAO,CAAC,CAAC;QAE5C,OAAO;YACL,YAAY,EAAE,KAAK;YACnB,IAAI,EAAE;gBACJ,EAAE,EAAE,IAAI,CAAC,EAAE;gBACX,IAAI,EAAE,IAAI,CAAC,IAAI;gBACf,KAAK,EAAE,IAAI,CAAC,KAAK;aAClB;SACF,CAAC;IACJ,CAAC;CACF,CAAA;AA5BY,kCAAW;sBAAX,WAAW;IADvB,IAAA,mBAAU,GAAE;qCAGY,4BAAY;QACb,gBAAU;GAHrB,WAAW,CA4BvB"} |
@ -1 +1 @@ |
|||||||
{"version":3,"file":"login-response.dto.js","sourceRoot":"","sources":["../../../src/auth/dto/login-response.dto.ts"],"names":[],"mappings":";;;AAEA,MAAa,gBAAgB;IACzB,YAAY,CAAS;IACrB,IAAI,CAAsB;CAC7B;AAHD,4CAGC"} |
{"version":3,"file":"login-response.dto.js","sourceRoot":"","sources":["../../../src/auth/dto/login-response.dto.ts"],"names":[],"mappings":";;;AAEA,MAAa,gBAAgB;IAC3B,YAAY,CAAS;IACrB,IAAI,CAAsB;CAC3B;AAHD,4CAGC"} |
@ -1 +1 @@ |
|||||||
{"version":3,"file":"login-user.dto.js","sourceRoot":"","sources":["../../../src/auth/dto/login-user.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAAsD;AAEtD,MAAa,YAAY;IAEZ,IAAI,CAAS;IAIb,QAAQ,CAAS;CAC7B;AAPD,oCAOC;AALY;IADR,IAAA,0BAAQ,GAAE;;0CACW;AAIb;IAFR,IAAA,0BAAQ,GAAE;IACV,IAAA,2BAAS,EAAC,CAAC,CAAC;;8CACa"} |
{"version":3,"file":"login-user.dto.js","sourceRoot":"","sources":["../../../src/auth/dto/login-user.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAAsD;AAEtD,MAAa,YAAY;IAEd,IAAI,CAAS;IAIb,QAAQ,CAAS;CAC3B;AAPD,oCAOC;AALU;IADR,IAAA,0BAAQ,GAAE;;0CACW;AAIb;IAFR,IAAA,0BAAQ,GAAE;IACV,IAAA,2BAAS,EAAC,CAAC,CAAC;;8CACa"} |
@ -1,10 +1,14 @@ |
|||||||
|
import { Strategy } from 'passport-jwt'; |
||||||
import { ConfigService } from '@nestjs/config'; |
import { ConfigService } from '@nestjs/config'; |
||||||
declare const JwtStrategy_base: new (...args: any) => any; |
import { JwtPayload } from 'src/common/interfaces/jwt-payload.interface'; |
||||||
|
declare const JwtStrategy_base: new (...args: [opt: import("passport-jwt").StrategyOptionsWithRequest] | [opt: import("passport-jwt").StrategyOptionsWithoutRequest]) => Strategy & { |
||||||
|
validate(...args: any[]): unknown; |
||||||
|
}; |
||||||
export declare class JwtStrategy extends JwtStrategy_base { |
export declare class JwtStrategy extends JwtStrategy_base { |
||||||
constructor(config: ConfigService); |
constructor(config: ConfigService); |
||||||
validate(payload: any): Promise<{ |
validate(payload: JwtPayload): { |
||||||
userId: any; |
userId: number; |
||||||
username: any; |
username: string; |
||||||
}>; |
}; |
||||||
} |
} |
||||||
export {}; |
export {}; |
||||||
|
@ -1 +1 @@ |
|||||||
{"version":3,"file":"jwt.stratedy.js","sourceRoot":"","sources":["../../src/auth/jwt.stratedy.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAC5C,+CAAoD;AACpD,+CAAoD;AACpD,2CAA+C;AAGxC,IAAM,WAAW,GAAjB,MAAM,WAAY,SAAQ,IAAA,2BAAgB,EAAC,uBAAQ,CAAC;IACzD,YAAY,MAAqB;QAC/B,KAAK,CAAC;YACJ,cAAc,EAAE,yBAAU,CAAC,2BAA2B,EAAE;YACxD,gBAAgB,EAAE,KAAK;YACvB,WAAW,EAAE,MAAM,CAAC,GAAG,CAAS,YAAY,CAAC;SAC9C,CAAC,CAAC;IACL,CAAC;IAED,KAAK,CAAC,QAAQ,CAAC,OAAY;QACzB,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,GAAG,EAAE,QAAQ,EAAE,OAAO,CAAC,QAAQ,EAAE,CAAC;IAC7D,CAAC;CACF,CAAA;AAZY,kCAAW;sBAAX,WAAW;IADvB,IAAA,mBAAU,GAAE;qCAES,sBAAa;GADtB,WAAW,CAYvB"} |
{"version":3,"file":"jwt.stratedy.js","sourceRoot":"","sources":["../../src/auth/jwt.stratedy.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAC5C,+CAAoD;AACpD,+CAAoD;AACpD,2CAA+C;AAIxC,IAAM,WAAW,GAAjB,MAAM,WAAY,SAAQ,IAAA,2BAAgB,EAAC,uBAAQ,CAAC;IACzD,YAAY,MAAqB;QAE/B,KAAK,CAAC;YAEJ,cAAc,EAAE,yBAAU,CAAC,2BAA2B,EAAE;YACxD,gBAAgB,EAAE,KAAK;YACvB,WAAW,EAAE,MAAM,CAAC,GAAG,CAAS,YAAY,CAAE;SAC/C,CAAC,CAAC;IACL,CAAC;IAED,QAAQ,CAAC,OAAmB;QAC1B,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,GAAG,EAAE,QAAQ,EAAE,OAAO,CAAC,QAAQ,EAAE,CAAC;IAC7D,CAAC;CACF,CAAA;AAdY,kCAAW;sBAAX,WAAW;IADvB,IAAA,mBAAU,GAAE;qCAES,sBAAa;GADtB,WAAW,CAcvB"} |
@ -1 +1 @@ |
|||||||
{"version":3,"file":"sucees-response.dto.js","sourceRoot":"","sources":["../../../src/common/dto/sucees-response.dto.ts"],"names":[],"mappings":";;;AAAA,MAAa,kBAAkB;IAC3B,OAAO,CAAU;IACjB,OAAO,CAAU;IACjB,IAAI,CAAK;IAET,MAAM,CAAC,EAAE,CAAI,IAAO,EAAE,OAAgB;QAClC,OAAO;YACH,OAAO,EAAE,IAAI;YACb,IAAI;YACJ,OAAO;SACV,CAAC;IACN,CAAC;IAED,MAAM,CAAC,EAAE,CAAC,OAAgB;QACtB,OAAO;YACH,OAAO,EAAE,IAAI;YACb,OAAO;SACV,CAAC;IACN,CAAC;CACJ;AAnBD,gDAmBC"} |
{"version":3,"file":"sucees-response.dto.js","sourceRoot":"","sources":["../../../src/common/dto/sucees-response.dto.ts"],"names":[],"mappings":";;;AAAA,MAAa,kBAAkB;IAC7B,OAAO,CAAU;IACjB,OAAO,CAAU;IACjB,IAAI,CAAK;IAET,MAAM,CAAC,EAAE,CAAI,IAAO,EAAE,OAAgB;QACpC,OAAO;YACL,OAAO,EAAE,IAAI;YACb,IAAI;YACJ,OAAO;SACR,CAAC;IACJ,CAAC;IAED,MAAM,CAAC,EAAE,CAAC,OAAgB;QACxB,OAAO;YACL,OAAO,EAAE,IAAI;YACb,OAAO;SACR,CAAC;IACJ,CAAC;CACF;AAnBD,gDAmBC"} |
@ -1 +1 @@ |
|||||||
{"version":3,"file":"timestamped.entity.js","sourceRoot":"","sources":["../../../src/common/entities/timestamped.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAA6D;AAE7D,MAAsB,iBAAiB;IAEnC,SAAS,CAAO;IAGhB,SAAS,CAAO;CACnB;AAND,8CAMC;AAJG;IADC,IAAA,0BAAgB,EAAC,EAAE,IAAI,EAAE,WAAW,EAAE,CAAC;8BAC7B,IAAI;oDAAC;AAGhB;IADC,IAAA,0BAAgB,EAAC,EAAE,IAAI,EAAE,WAAW,EAAE,CAAC;8BAC7B,IAAI;oDAAC"} |
{"version":3,"file":"timestamped.entity.js","sourceRoot":"","sources":["../../../src/common/entities/timestamped.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAA6D;AAE7D,MAAsB,iBAAiB;IAErC,SAAS,CAAO;IAGhB,SAAS,CAAO;CACjB;AAND,8CAMC;AAJC;IADC,IAAA,0BAAgB,EAAC,EAAE,IAAI,EAAE,WAAW,EAAE,CAAC;8BAC7B,IAAI;oDAAC;AAGhB;IADC,IAAA,0BAAgB,EAAC,EAAE,IAAI,EAAE,WAAW,EAAE,CAAC;8BAC7B,IAAI;oDAAC"} |
@ -1 +1 @@ |
|||||||
{"version":3,"file":"main.js","sourceRoot":"","sources":["../src/main.ts"],"names":[],"mappings":";;AAAA,uCAA2C;AAC3C,6CAAyC;AACzC,2CAAgD;AAEhD,KAAK,UAAU,SAAS;IACtB,MAAM,GAAG,GAAG,MAAM,kBAAW,CAAC,MAAM,CAAC,sBAAS,CAAC,CAAC;IAChD,GAAG,CAAC,UAAU,EAAE,CAAC;IACjB,GAAG,CAAC,cAAc,CAChB,IAAI,uBAAc,CAAC;QACjB,SAAS,EAAE,IAAI;QACf,oBAAoB,EAAE,IAAI;QAC1B,SAAS,EAAE,IAAI;KAChB,CAAC,CACH,CAAC;IACF,MAAM,GAAG,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,IAAI,IAAI,CAAC,CAAC;AAC7C,CAAC;AACD,SAAS,EAAE,CAAC"} |
{"version":3,"file":"main.js","sourceRoot":"","sources":["../src/main.ts"],"names":[],"mappings":";;AAAA,uCAA2C;AAC3C,6CAAyC;AACzC,2CAAgD;AAEhD,KAAK,UAAU,SAAS;IACtB,MAAM,GAAG,GAAG,MAAM,kBAAW,CAAC,MAAM,CAAC,sBAAS,CAAC,CAAC;IAChD,IAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,YAAY;QAAE,GAAG,CAAC,UAAU,EAAE,CAAC;IAC5D,GAAG,CAAC,cAAc,CAChB,IAAI,uBAAc,CAAC;QACjB,SAAS,EAAE,IAAI;QACf,oBAAoB,EAAE,IAAI;QAC1B,SAAS,EAAE,IAAI;KAChB,CAAC,CACH,CAAC;IACF,MAAM,GAAG,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,IAAI,IAAI,CAAC,CAAC;AAC7C,CAAC;AACD,SAAS,EAAE,CAAC"} |
File diff suppressed because one or more lines are too long
@ -1 +1 @@ |
|||||||
{"version":3,"file":"change-password.dto.js","sourceRoot":"","sources":["../../../src/users/dto/change-password.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAA2E;AAE3E,MAAa,iBAAiB;IAEjB,eAAe,CAAS;IAIxB,WAAW,CAAS;CAChC;AAPD,8CAOC;AALY;IADR,IAAA,0BAAQ,GAAE;;0DACsB;AAIxB;IAFR,IAAA,0BAAQ,GAAE;IACV,IAAA,2BAAS,EAAC,CAAC,CAAC;;sDACgB"} |
{"version":3,"file":"change-password.dto.js","sourceRoot":"","sources":["../../../src/users/dto/change-password.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAAsD;AAEtD,MAAa,iBAAiB;IAEnB,eAAe,CAAS;IAIxB,WAAW,CAAS;CAC9B;AAPD,8CAOC;AALU;IADR,IAAA,0BAAQ,GAAE;;0DACsB;AAIxB;IAFR,IAAA,0BAAQ,GAAE;IACV,IAAA,2BAAS,EAAC,CAAC,CAAC;;sDACgB"} |
@ -1 +1 @@ |
|||||||
{"version":3,"file":"create-user.dto.js","sourceRoot":"","sources":["../../../src/users/dto/create-user.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAA2E;AAE3E,MAAa,aAAa;IAEb,IAAI,CAAS;IAIb,KAAK,CAAU;IAIf,QAAQ,CAAS;CAC7B;AAXD,sCAWC;AATY;IADR,IAAA,0BAAQ,GAAE;;2CACW;AAIb;IAFR,IAAA,4BAAU,GAAE;IACZ,IAAA,yBAAO,GAAE;;4CACc;AAIf;IAFR,IAAA,0BAAQ,GAAE;IACV,IAAA,2BAAS,EAAC,CAAC,CAAC;;+CACa"} |
{"version":3,"file":"create-user.dto.js","sourceRoot":"","sources":["../../../src/users/dto/create-user.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAA2E;AAE3E,MAAa,aAAa;IAEf,IAAI,CAAS;IAIb,KAAK,CAAU;IAIf,QAAQ,CAAS;CAC3B;AAXD,sCAWC;AATU;IADR,IAAA,0BAAQ,GAAE;;2CACW;AAIb;IAFR,IAAA,4BAAU,GAAE;IACZ,IAAA,yBAAO,GAAE;;4CACc;AAIf;IAFR,IAAA,0BAAQ,GAAE;IACV,IAAA,2BAAS,EAAC,CAAC,CAAC;;+CACa"} |
@ -1 +1 @@ |
|||||||
{"version":3,"file":"user-info-response.dto.js","sourceRoot":"","sources":["../../../src/users/dto/user-info-response.dto.ts"],"names":[],"mappings":";;;AAAA,MAAa,mBAAmB;IAC5B,EAAE,CAAS;IACX,IAAI,CAAS;IACb,KAAK,CAAU;CAClB;AAJD,kDAIC"} |
{"version":3,"file":"user-info-response.dto.js","sourceRoot":"","sources":["../../../src/users/dto/user-info-response.dto.ts"],"names":[],"mappings":";;;AAAA,MAAa,mBAAmB;IAC9B,EAAE,CAAS;IACX,IAAI,CAAS;IACb,KAAK,CAAU;CAChB;AAJD,kDAIC"} |
@ -1 +1 @@ |
|||||||
{"version":3,"file":"user.entity.js","sourceRoot":"","sources":["../../src/users/user.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,8EAA2E;AAC3E,qCAAiE;AAG1D,IAAM,IAAI,GAAV,MAAM,IAAK,SAAQ,sCAAiB;IAEvC,EAAE,CAAS;IAGX,IAAI,CAAS;IAGb,KAAK,CAAU;IAGf,QAAQ,CAAS;CACpB,CAAA;AAZY,oBAAI;AAEb;IADC,IAAA,gCAAsB,GAAE;;gCACd;AAGX;IADC,IAAA,gBAAM,EAAC,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;;kCACZ;AAGb;IADC,IAAA,gBAAM,EAAC,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;mCAC1B;AAGf;IADC,IAAA,gBAAM,GAAE;;sCACQ;eAXR,IAAI;IADhB,IAAA,gBAAM,GAAE;GACI,IAAI,CAYhB"} |
{"version":3,"file":"user.entity.js","sourceRoot":"","sources":["../../src/users/user.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,8EAA2E;AAC3E,qCAAiE;AAG1D,IAAM,IAAI,GAAV,MAAM,IAAK,SAAQ,sCAAiB;IAEzC,EAAE,CAAS;IAGX,IAAI,CAAS;IAGb,KAAK,CAAU;IAGf,QAAQ,CAAS;CAClB,CAAA;AAZY,oBAAI;AAEf;IADC,IAAA,gCAAsB,GAAE;;gCACd;AAGX;IADC,IAAA,gBAAM,EAAC,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;;kCACZ;AAGb;IADC,IAAA,gBAAM,EAAC,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;mCAC1B;AAGf;IADC,IAAA,gBAAM,GAAE;;sCACQ;eAXN,IAAI;IADhB,IAAA,gBAAM,GAAE;GACI,IAAI,CAYhB"} |
@ -1,8 +1,9 @@ |
|||||||
import { UsersService } from './users.service'; |
import { UsersService } from './users.service'; |
||||||
import { ChangePasswordDto } from './dto/change-password.dto'; |
import { ChangePasswordDto } from './dto/change-password.dto'; |
||||||
import { SuccessResponseDto } from 'src/common/dto/sucees-response.dto'; |
import { SuccessResponseDto } from 'src/common/dto/sucees-response.dto'; |
||||||
|
import { AuthRequest } from 'src/common/interfaces/auth-request.interface'; |
||||||
export declare class UsersController { |
export declare class UsersController { |
||||||
private readonly userService; |
private readonly userService; |
||||||
constructor(userService: UsersService); |
constructor(userService: UsersService); |
||||||
changePassword(req: any, dto: ChangePasswordDto): Promise<SuccessResponseDto>; |
changePassword(req: AuthRequest, dto: ChangePasswordDto): Promise<SuccessResponseDto>; |
||||||
} |
} |
||||||
|
@ -1 +1 @@ |
|||||||
{"version":3,"file":"users.controller.js","sourceRoot":"","sources":["../../src/users/users.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAA6E;AAC7E,mDAA+C;AAC/C,mEAA8D;AAC9D,2DAAuD;AACvD,2EAAwE;AAGjE,IAAM,eAAe,GAArB,MAAM,eAAe;IACK;IAA7B,YAA6B,WAAyB;QAAzB,gBAAW,GAAX,WAAW,CAAc;IAAG,CAAC;IAIpD,AAAN,KAAK,CAAC,cAAc,CAAY,GAAG,EAAU,GAAsB;QAC/D,MAAM,IAAI,CAAC,WAAW,CAAC,cAAc,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;QAC5D,OAAO,wCAAkB,CAAC,EAAE,EAAE,CAAC;IACnC,CAAC;CACJ,CAAA;AATY,0CAAe;AAKlB;IAFL,IAAA,kBAAS,EAAC,6BAAY,CAAC;IACvB,IAAA,cAAK,EAAC,UAAU,CAAC;IACI,WAAA,IAAA,gBAAO,GAAE,CAAA;IAAO,WAAA,IAAA,aAAI,GAAE,CAAA;;6CAAM,uCAAiB;;qDAGlE;0BARQ,eAAe;IAD3B,IAAA,mBAAU,EAAC,OAAO,CAAC;qCAE0B,4BAAY;GAD7C,eAAe,CAS3B"} |
{"version":3,"file":"users.controller.js","sourceRoot":"","sources":["../../src/users/users.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAA6E;AAC7E,mDAA+C;AAC/C,mEAA8D;AAC9D,2DAAuD;AACvD,2EAAwE;AAIjE,IAAM,eAAe,GAArB,MAAM,eAAe;IACG;IAA7B,YAA6B,WAAyB;QAAzB,gBAAW,GAAX,WAAW,CAAc;IAAG,CAAC;IAIpD,AAAN,KAAK,CAAC,cAAc,CACP,GAAgB,EACnB,GAAsB;QAE9B,MAAM,IAAI,CAAC,WAAW,CAAC,cAAc,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;QAC5D,OAAO,wCAAkB,CAAC,EAAE,EAAE,CAAC;IACjC,CAAC;CACF,CAAA;AAZY,0CAAe;AAKpB;IAFL,IAAA,kBAAS,EAAC,6BAAY,CAAC;IACvB,IAAA,cAAK,EAAC,UAAU,CAAC;IAEf,WAAA,IAAA,gBAAO,GAAE,CAAA;IACT,WAAA,IAAA,aAAI,GAAE,CAAA;;6CAAM,uCAAiB;;qDAI/B;0BAXU,eAAe;IAD3B,IAAA,mBAAU,EAAC,OAAO,CAAC;qCAEwB,4BAAY;GAD3C,eAAe,CAY3B"} |
@ -1 +1 @@ |
|||||||
{"version":3,"file":"users.service.js","sourceRoot":"","sources":["../../src/users/users.service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C;QAC/E,IAAI,CAAC,aAAa;YAAE,MAAM,IAAI,8BAAqB,CAAC,sBAAsB,CAAC,CAAC;QAE5E,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,WAAW,EAAE,EAAE,CAAC,CAAC;QACtD,IAAI,CAAC,QAAQ,GAAG,MAAM,CAAC;QAEvB,MAAM,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC7B,CAAC;IAED,KAAK,CAAC,sBAAsB,CAAC,EAAU;QACrC,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;QACrC,IAAI,CAAC,IAAI;YAAE,MAAM,IAAI,0BAAiB,CAAC,gBAAgB,CAAC,CAAC;QAEzD,OAAO;YACL,EAAE,EAAE,IAAI,CAAC,EAAE;YACX,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,KAAK,EAAE,IAAI,CAAC,KAAK;SAClB,CAAC;IACJ,CAAC;CACF,CAAA;AA9CY,oCAAY;uBAAZ,YAAY;IADxB,IAAA,mBAAU,GAAE;IAEE,WAAA,IAAA,0BAAgB,EAAC,kBAAI,CAAC,CAAA;qCAAe,oBAAU;GADjD,YAAY,CA8CxB"} |
@ -1,34 +1,38 @@ |
|||||||
import { BadRequestException, Injectable, InternalServerErrorException, UnauthorizedException } from '@nestjs/common'; |
import { Injectable, UnauthorizedException } from '@nestjs/common'; |
||||||
import { JwtService } from '@nestjs/jwt'; |
import { JwtService } from '@nestjs/jwt'; |
||||||
import { UsersService } from 'src/users/users.service'; |
import { UsersService } from 'src/users/users.service'; |
||||||
import * as bcrypt from 'bcrypt' |
import * as bcrypt from 'bcryptjs'; |
||||||
import { LoginUserDto } from 'src/auth/dto/login-user.dto'; |
import { LoginUserDto } from 'src/auth/dto/login-user.dto'; |
||||||
import { CreateUserDto } from 'src/users/dto/create-user.dto'; |
import { CreateUserDto } from 'src/users/dto/create-user.dto'; |
||||||
import { LoginResponseDto } from './dto/login-response.dto'; |
import { LoginResponseDto } from './dto/login-response.dto'; |
||||||
|
|
||||||
@Injectable() |
@Injectable() |
||||||
export class AuthService { |
export class AuthService { |
||||||
constructor(private userService: UsersService, private jwtService: JwtService) {} |
constructor( |
||||||
|
private userService: UsersService, |
||||||
|
private jwtService: JwtService, |
||||||
|
) {} |
||||||
|
|
||||||
async signup(dto: CreateUserDto) { |
async signup(dto: CreateUserDto) { |
||||||
const hashed = await bcrypt.hash(dto.password, 10); |
const hashed: string = await bcrypt.hash(dto.password, 10); |
||||||
return this.userService.create({ ...dto, password: hashed }); |
return this.userService.create({ ...dto, password: hashed }); |
||||||
} |
} |
||||||
|
|
||||||
async login(dto: LoginUserDto): Promise<LoginResponseDto> { |
async login(dto: LoginUserDto): Promise<LoginResponseDto> { |
||||||
const user = await this.userService.findByName(dto.name); |
const user = await this.userService.findByName(dto.name); |
||||||
if (!user || !await bcrypt.compare(dto.password, user.password)) throw new UnauthorizedException('Login failed'); |
if (!user || !(await bcrypt.compare(dto.password, user.password))) |
||||||
|
throw new UnauthorizedException('Login failed'); |
||||||
|
|
||||||
const payload = { username: user.name, sub: user.id }; |
const payload = { username: user.name, sub: user.id }; |
||||||
const token = this.jwtService.sign(payload); |
const token = this.jwtService.sign(payload); |
||||||
|
|
||||||
return { |
return { |
||||||
access_token: token, |
access_token: token, |
||||||
user: { |
user: { |
||||||
id: user.id, |
id: user.id, |
||||||
name: user.name, |
name: user.name, |
||||||
email: user.email, |
email: user.email, |
||||||
} |
}, |
||||||
}; |
}; |
||||||
} |
} |
||||||
} |
} |
||||||
|
@ -1,6 +1,6 @@ |
|||||||
import { UserInfoResponseDto } from "src/users/dto/user-info-response.dto"; |
import { UserInfoResponseDto } from 'src/users/dto/user-info-response.dto'; |
||||||
|
|
||||||
export class LoginResponseDto { |
export class LoginResponseDto { |
||||||
access_token: string; |
access_token: string; |
||||||
user: UserInfoResponseDto; |
user: UserInfoResponseDto; |
||||||
} |
} |
||||||
|
@ -1,10 +1,10 @@ |
|||||||
import { IsString, MinLength } from "class-validator"; |
import { IsString, MinLength } from 'class-validator'; |
||||||
|
|
||||||
export class LoginUserDto { |
export class LoginUserDto { |
||||||
@IsString() |
@IsString() |
||||||
readonly name: string; |
readonly name: string; |
||||||
|
|
||||||
@IsString() |
@IsString() |
||||||
@MinLength(4) |
@MinLength(4) |
||||||
readonly password: string; |
readonly password: string; |
||||||
} |
} |
||||||
|
@ -1,5 +1,5 @@ |
|||||||
import { Injectable } from "@nestjs/common"; |
import { Injectable } from '@nestjs/common'; |
||||||
import { AuthGuard } from "@nestjs/passport"; |
import { AuthGuard } from '@nestjs/passport'; |
||||||
|
|
||||||
@Injectable() |
@Injectable() |
||||||
export class JwtAuthGuard extends AuthGuard('jwt') {} |
export class JwtAuthGuard extends AuthGuard('jwt') {} |
||||||
|
@ -1,20 +1,20 @@ |
|||||||
export class SuccessResponseDto<T = any> { |
export class SuccessResponseDto<T = any> { |
||||||
success: boolean; |
success: boolean; |
||||||
message?: string; |
message?: string; |
||||||
data?: T; |
data?: T; |
||||||
|
|
||||||
static of<T>(data: T, message?: string): SuccessResponseDto<T> { |
static of<T>(data: T, message?: string): SuccessResponseDto<T> { |
||||||
return { |
return { |
||||||
success: true, |
success: true, |
||||||
data, |
data, |
||||||
message, |
message, |
||||||
}; |
}; |
||||||
} |
} |
||||||
|
|
||||||
static ok(message?: string): SuccessResponseDto<null> { |
static ok(message?: string): SuccessResponseDto<null> { |
||||||
return { |
return { |
||||||
success: true, |
success: true, |
||||||
message, |
message, |
||||||
}; |
}; |
||||||
} |
} |
||||||
} |
} |
||||||
|
@ -1,9 +1,9 @@ |
|||||||
import { CreateDateColumn, UpdateDateColumn } from "typeorm"; |
import { CreateDateColumn, UpdateDateColumn } from 'typeorm'; |
||||||
|
|
||||||
export abstract class TimestampedEntity { |
export abstract class TimestampedEntity { |
||||||
@CreateDateColumn({ type: 'timestamp' }) |
@CreateDateColumn({ type: 'timestamp' }) |
||||||
createdAt: Date; |
createdAt: Date; |
||||||
|
|
||||||
@UpdateDateColumn({ type: 'timestamp' }) |
@UpdateDateColumn({ type: 'timestamp' }) |
||||||
updatedAt: Date; |
updatedAt: Date; |
||||||
} |
} |
||||||
|
@ -0,0 +1,6 @@ |
|||||||
|
export interface AuthRequest extends Request { |
||||||
|
user: { |
||||||
|
userId: number; |
||||||
|
username: string; |
||||||
|
}; |
||||||
|
} |
@ -0,0 +1,4 @@ |
|||||||
|
export interface JwtPayload { |
||||||
|
sub: number; |
||||||
|
username: string; |
||||||
|
} |
@ -1,10 +1,10 @@ |
|||||||
import { IsEmail, IsOptional, IsString, MinLength } from "class-validator"; |
import { IsString, MinLength } from 'class-validator'; |
||||||
|
|
||||||
export class ChangePasswordDto { |
export class ChangePasswordDto { |
||||||
@IsString() |
@IsString() |
||||||
readonly currentPassword: string; |
readonly currentPassword: string; |
||||||
|
|
||||||
@IsString() |
@IsString() |
||||||
@MinLength(4) |
@MinLength(4) |
||||||
readonly newPassword: string; |
readonly newPassword: string; |
||||||
} |
} |
||||||
|
@ -1,14 +1,14 @@ |
|||||||
import { IsEmail, IsOptional, IsString, MinLength } from "class-validator"; |
import { IsEmail, IsOptional, IsString, MinLength } from 'class-validator'; |
||||||
|
|
||||||
export class CreateUserDto { |
export class CreateUserDto { |
||||||
@IsString() |
@IsString() |
||||||
readonly name: string; |
readonly name: string; |
||||||
|
|
||||||
@IsOptional() |
@IsOptional() |
||||||
@IsEmail() |
@IsEmail() |
||||||
readonly email?: string; |
readonly email?: string; |
||||||
|
|
||||||
@IsString() |
@IsString() |
||||||
@MinLength(4) |
@MinLength(4) |
||||||
readonly password: string; |
readonly password: string; |
||||||
} |
} |
||||||
|
@ -1,5 +1,5 @@ |
|||||||
export class UserInfoResponseDto { |
export class UserInfoResponseDto { |
||||||
id: number; |
id: number; |
||||||
name: string; |
name: string; |
||||||
email?: string; |
email?: string; |
||||||
} |
} |
||||||
|
@ -1,17 +1,17 @@ |
|||||||
import { TimestampedEntity } from "src/common/entities/timestamped.entity"; |
import { TimestampedEntity } from 'src/common/entities/timestamped.entity'; |
||||||
import { Column, Entity, PrimaryGeneratedColumn } from "typeorm"; |
import { Column, Entity, PrimaryGeneratedColumn } from 'typeorm'; |
||||||
|
|
||||||
@Entity() |
@Entity() |
||||||
export class User extends TimestampedEntity { |
export class User extends TimestampedEntity { |
||||||
@PrimaryGeneratedColumn() |
@PrimaryGeneratedColumn() |
||||||
id: number; |
id: number; |
||||||
|
|
||||||
@Column({ unique: true }) |
@Column({ unique: true }) |
||||||
name: string; |
name: string; |
||||||
|
|
||||||
@Column({ unique: true, nullable: true }) |
@Column({ unique: true, nullable: true }) |
||||||
email?: string; |
email?: string; |
||||||
|
|
||||||
@Column() |
@Column() |
||||||
password: string; |
password: string; |
||||||
} |
} |
||||||
|
@ -1,57 +1,62 @@ |
|||||||
import { BadRequestException, Injectable, NotFoundException, UnauthorizedException } from '@nestjs/common'; |
import { |
||||||
|
BadRequestException, |
||||||
|
Injectable, |
||||||
|
NotFoundException, |
||||||
|
UnauthorizedException, |
||||||
|
} from '@nestjs/common'; |
||||||
import { InjectRepository } from '@nestjs/typeorm'; |
import { InjectRepository } from '@nestjs/typeorm'; |
||||||
import { User } from './user.entity'; |
import { User } from './user.entity'; |
||||||
import { Repository } from 'typeorm'; |
import { Repository } from 'typeorm'; |
||||||
import { CreateUserDto } from './dto/create-user.dto'; |
import { CreateUserDto } from './dto/create-user.dto'; |
||||||
import { ChangePasswordDto } from './dto/change-password.dto'; |
import { ChangePasswordDto } from './dto/change-password.dto'; |
||||||
import * as bcrypt from "bcrypt" |
import * as bcrypt from 'bcryptjs'; |
||||||
import { UserInfoResponseDto } from './dto/user-info-response.dto'; |
import { UserInfoResponseDto } from './dto/user-info-response.dto'; |
||||||
|
|
||||||
@Injectable() |
@Injectable() |
||||||
export class UsersService { |
export class UsersService { |
||||||
constructor(@InjectRepository(User) private repo: Repository<User>) {} |
constructor(@InjectRepository(User) private repo: Repository<User>) {} |
||||||
|
|
||||||
async findById(id: number): Promise<User | null> { |
async findById(id: number): Promise<User | null> { |
||||||
return await this.repo.findOne({ where: { id }}); |
return await this.repo.findOne({ where: { id } }); |
||||||
} |
} |
||||||
|
|
||||||
async findByName(name: string): Promise<User | null> { |
async findByName(name: string): Promise<User | null> { |
||||||
return await this.repo.findOne({ where: { name }}); |
return await this.repo.findOne({ where: { name } }); |
||||||
} |
} |
||||||
|
|
||||||
async findByEmail(email: string): Promise<User | null> { |
async findByEmail(email: string): Promise<User | null> { |
||||||
return await this.repo.findOne({ where: { email }}); |
return await this.repo.findOne({ where: { email } }); |
||||||
} |
} |
||||||
|
|
||||||
async create(dto: CreateUserDto): Promise<User> { |
async create(dto: CreateUserDto): Promise<User> { |
||||||
const existing = await this.findByName(dto.name); |
const existing = await this.findByName(dto.name); |
||||||
if (existing) throw new BadRequestException("Already existed user"); |
if (existing) throw new BadRequestException('Already existed user'); |
||||||
|
|
||||||
const user = this.repo.create(dto); |
const user = this.repo.create(dto); |
||||||
return this.repo.save(user); |
return this.repo.save(user); |
||||||
} |
} |
||||||
|
|
||||||
async changePassword(userId: number, dto: ChangePasswordDto): Promise<void> { |
async changePassword(userId: number, dto: ChangePasswordDto): Promise<void> { |
||||||
const user = await this.repo.findOne({ where: { id: userId } }); |
const user = await this.repo.findOne({ where: { id: userId } }); |
||||||
if (!user) throw new NotFoundException("User not found"); |
if (!user) throw new NotFoundException('User not found'); |
||||||
|
|
||||||
const passwordValid = await bcrypt.compare(dto.currentPassword, user.password); |
const passwordValid = await bcrypt.compare(dto.currentPassword, user.password); |
||||||
if (!passwordValid) throw new UnauthorizedException("Not matched password"); |
if (!passwordValid) throw new UnauthorizedException('Not matched password'); |
||||||
|
|
||||||
const hashed = await bcrypt.hash(dto.newPassword, 10); |
const hashed = await bcrypt.hash(dto.newPassword, 10); |
||||||
user.password = hashed; |
user.password = hashed; |
||||||
|
|
||||||
await this.repo.save(user); |
await this.repo.save(user); |
||||||
} |
} |
||||||
|
|
||||||
async findUserInfoByIdOrFail(id: number): Promise<UserInfoResponseDto> { |
async findUserInfoByIdOrFail(id: number): Promise<UserInfoResponseDto> { |
||||||
const user = await this.findById(id); |
const user = await this.findById(id); |
||||||
if (!user) throw new NotFoundException("User not found"); |
if (!user) throw new NotFoundException('User not found'); |
||||||
|
|
||||||
return { |
return { |
||||||
id: user.id, |
id: user.id, |
||||||
name: user.name, |
name: user.name, |
||||||
email: user.email, |
email: user.email, |
||||||
}; |
}; |
||||||
} |
} |
||||||
} |
} |
||||||
|
@ -1,10 +0,0 @@ |
|||||||
NODE_ENV=development |
|
||||||
|
|
||||||
DB_HOST=localhost |
|
||||||
DB_PORT=3306 |
|
||||||
DB_USERNAME=root |
|
||||||
DB_PASSWORD=init00!! |
|
||||||
DB_DATABASE=boilerplate_db |
|
||||||
|
|
||||||
JWT_SECRET=jwt-secret |
|
||||||
JWT_EXPIRES_IN=1h |
|
@ -1,4 +0,0 @@ |
|||||||
{ |
|
||||||
"singleQuote": true, |
|
||||||
"trailingComma": "all" |
|
||||||
} |
|
@ -1,22 +0,0 @@ |
|||||||
{ |
|
||||||
// IntelliSense를 사용하여 가능한 특성에 대해 알아보세요. |
|
||||||
// 기존 특성에 대한 설명을 보려면 가리킵니다. |
|
||||||
// 자세한 내용을 보려면 https://go.microsoft.com/fwlink/?linkid=830387을(를) 방문하세요. |
|
||||||
"version": "0.2.0", |
|
||||||
"configurations": [ |
|
||||||
{ |
|
||||||
"type": "node", |
|
||||||
"request": "launch", |
|
||||||
"name": "Debug NestJS", // 디버깅 이름 |
|
||||||
"runtimeExecutable": "npm", // 실행 인터프리터 |
|
||||||
"runtimeArgs": [ |
|
||||||
// npm run start:debug |
|
||||||
"run", |
|
||||||
"start:debug", |
|
||||||
], |
|
||||||
"console": "integratedTerminal", // 터미널로 셋팅 |
|
||||||
"restart": true, |
|
||||||
"autoAttachChildProcesses": true |
|
||||||
} |
|
||||||
] |
|
||||||
} |
|
@ -1,98 +0,0 @@ |
|||||||
<p align="center"> |
|
||||||
<a href="http://nestjs.com/" target="blank"><img src="https://nestjs.com/img/logo-small.svg" width="120" alt="Nest Logo" /></a> |
|
||||||
</p> |
|
||||||
|
|
||||||
[circleci-image]: https://img.shields.io/circleci/build/github/nestjs/nest/master?token=abc123def456 |
|
||||||
[circleci-url]: https://circleci.com/gh/nestjs/nest |
|
||||||
|
|
||||||
<p align="center">A progressive <a href="http://nodejs.org" target="_blank">Node.js</a> framework for building efficient and scalable server-side applications.</p> |
|
||||||
<p align="center"> |
|
||||||
<a href="https://www.npmjs.com/~nestjscore" target="_blank"><img src="https://img.shields.io/npm/v/@nestjs/core.svg" alt="NPM Version" /></a> |
|
||||||
<a href="https://www.npmjs.com/~nestjscore" target="_blank"><img src="https://img.shields.io/npm/l/@nestjs/core.svg" alt="Package License" /></a> |
|
||||||
<a href="https://www.npmjs.com/~nestjscore" target="_blank"><img src="https://img.shields.io/npm/dm/@nestjs/common.svg" alt="NPM Downloads" /></a> |
|
||||||
<a href="https://circleci.com/gh/nestjs/nest" target="_blank"><img src="https://img.shields.io/circleci/build/github/nestjs/nest/master" alt="CircleCI" /></a> |
|
||||||
<a href="https://discord.gg/G7Qnnhy" target="_blank"><img src="https://img.shields.io/badge/discord-online-brightgreen.svg" alt="Discord"/></a> |
|
||||||
<a href="https://opencollective.com/nest#backer" target="_blank"><img src="https://opencollective.com/nest/backers/badge.svg" alt="Backers on Open Collective" /></a> |
|
||||||
<a href="https://opencollective.com/nest#sponsor" target="_blank"><img src="https://opencollective.com/nest/sponsors/badge.svg" alt="Sponsors on Open Collective" /></a> |
|
||||||
<a href="https://paypal.me/kamilmysliwiec" target="_blank"><img src="https://img.shields.io/badge/Donate-PayPal-ff3f59.svg" alt="Donate us"/></a> |
|
||||||
<a href="https://opencollective.com/nest#sponsor" target="_blank"><img src="https://img.shields.io/badge/Support%20us-Open%20Collective-41B883.svg" alt="Support us"></a> |
|
||||||
<a href="https://twitter.com/nestframework" target="_blank"><img src="https://img.shields.io/twitter/follow/nestframework.svg?style=social&label=Follow" alt="Follow us on Twitter"></a> |
|
||||||
</p> |
|
||||||
<!--[](https://opencollective.com/nest#backer) |
|
||||||
[](https://opencollective.com/nest#sponsor)--> |
|
||||||
|
|
||||||
## Description |
|
||||||
|
|
||||||
[Nest](https://github.com/nestjs/nest) framework TypeScript starter repository. |
|
||||||
|
|
||||||
## Project setup |
|
||||||
|
|
||||||
```bash |
|
||||||
$ npm install |
|
||||||
``` |
|
||||||
|
|
||||||
## Compile and run the project |
|
||||||
|
|
||||||
```bash |
|
||||||
# development |
|
||||||
$ npm run start |
|
||||||
|
|
||||||
# watch mode |
|
||||||
$ npm run start:dev |
|
||||||
|
|
||||||
# production mode |
|
||||||
$ npm run start:prod |
|
||||||
``` |
|
||||||
|
|
||||||
## Run tests |
|
||||||
|
|
||||||
```bash |
|
||||||
# unit tests |
|
||||||
$ npm run test |
|
||||||
|
|
||||||
# e2e tests |
|
||||||
$ npm run test:e2e |
|
||||||
|
|
||||||
# test coverage |
|
||||||
$ npm run test:cov |
|
||||||
``` |
|
||||||
|
|
||||||
## Deployment |
|
||||||
|
|
||||||
When you're ready to deploy your NestJS application to production, there are some key steps you can take to ensure it runs as efficiently as possible. Check out the [deployment documentation](https://docs.nestjs.com/deployment) for more information. |
|
||||||
|
|
||||||
If you are looking for a cloud-based platform to deploy your NestJS application, check out [Mau](https://mau.nestjs.com), our official platform for deploying NestJS applications on AWS. Mau makes deployment straightforward and fast, requiring just a few simple steps: |
|
||||||
|
|
||||||
```bash |
|
||||||
$ npm install -g @nestjs/mau |
|
||||||
$ mau deploy |
|
||||||
``` |
|
||||||
|
|
||||||
With Mau, you can deploy your application in just a few clicks, allowing you to focus on building features rather than managing infrastructure. |
|
||||||
|
|
||||||
## Resources |
|
||||||
|
|
||||||
Check out a few resources that may come in handy when working with NestJS: |
|
||||||
|
|
||||||
- Visit the [NestJS Documentation](https://docs.nestjs.com) to learn more about the framework. |
|
||||||
- For questions and support, please visit our [Discord channel](https://discord.gg/G7Qnnhy). |
|
||||||
- To dive deeper and get more hands-on experience, check out our official video [courses](https://courses.nestjs.com/). |
|
||||||
- Deploy your application to AWS with the help of [NestJS Mau](https://mau.nestjs.com) in just a few clicks. |
|
||||||
- Visualize your application graph and interact with the NestJS application in real-time using [NestJS Devtools](https://devtools.nestjs.com). |
|
||||||
- Need help with your project (part-time to full-time)? Check out our official [enterprise support](https://enterprise.nestjs.com). |
|
||||||
- To stay in the loop and get updates, follow us on [X](https://x.com/nestframework) and [LinkedIn](https://linkedin.com/company/nestjs). |
|
||||||
- Looking for a job, or have a job to offer? Check out our official [Jobs board](https://jobs.nestjs.com). |
|
||||||
|
|
||||||
## Support |
|
||||||
|
|
||||||
Nest is an MIT-licensed open source project. It can grow thanks to the sponsors and support by the amazing backers. If you'd like to join them, please [read more here](https://docs.nestjs.com/support). |
|
||||||
|
|
||||||
## Stay in touch |
|
||||||
|
|
||||||
- Author - [Kamil Myśliwiec](https://twitter.com/kammysliwiec) |
|
||||||
- Website - [https://nestjs.com](https://nestjs.com/) |
|
||||||
- Twitter - [@nestframework](https://twitter.com/nestframework) |
|
||||||
|
|
||||||
## License |
|
||||||
|
|
||||||
Nest is [MIT licensed](https://github.com/nestjs/nest/blob/master/LICENSE). |
|
@ -1,6 +0,0 @@ |
|||||||
import { AppService } from './app.service'; |
|
||||||
export declare class AppController { |
|
||||||
private readonly appService; |
|
||||||
constructor(appService: AppService); |
|
||||||
getHello(): string; |
|
||||||
} |
|
@ -1,35 +0,0 @@ |
|||||||
"use strict"; |
|
||||||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { |
|
||||||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; |
|
||||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); |
|
||||||
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; |
|
||||||
return c > 3 && r && Object.defineProperty(target, key, r), r; |
|
||||||
}; |
|
||||||
var __metadata = (this && this.__metadata) || function (k, v) { |
|
||||||
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); |
|
||||||
}; |
|
||||||
Object.defineProperty(exports, "__esModule", { value: true }); |
|
||||||
exports.AppController = void 0; |
|
||||||
const common_1 = require("@nestjs/common"); |
|
||||||
const app_service_1 = require("./app.service"); |
|
||||||
let AppController = class AppController { |
|
||||||
appService; |
|
||||||
constructor(appService) { |
|
||||||
this.appService = appService; |
|
||||||
} |
|
||||||
getHello() { |
|
||||||
return this.appService.getHello(); |
|
||||||
} |
|
||||||
}; |
|
||||||
exports.AppController = AppController; |
|
||||||
__decorate([ |
|
||||||
(0, common_1.Get)(), |
|
||||||
__metadata("design:type", Function), |
|
||||||
__metadata("design:paramtypes", []), |
|
||||||
__metadata("design:returntype", String) |
|
||||||
], AppController.prototype, "getHello", null); |
|
||||||
exports.AppController = AppController = __decorate([ |
|
||||||
(0, common_1.Controller)(), |
|
||||||
__metadata("design:paramtypes", [app_service_1.AppService]) |
|
||||||
], AppController); |
|
||||||
//# sourceMappingURL=app.controller.js.map
|
|
@ -1 +0,0 @@ |
|||||||
{"version":3,"file":"app.controller.js","sourceRoot":"","sources":["../src/app.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAAiD;AACjD,+CAA2C;AAGpC,IAAM,aAAa,GAAnB,MAAM,aAAa;IACK;IAA7B,YAA6B,UAAsB;QAAtB,eAAU,GAAV,UAAU,CAAY;IAAG,CAAC;IAGvD,QAAQ;QACN,OAAO,IAAI,CAAC,UAAU,CAAC,QAAQ,EAAE,CAAC;IACpC,CAAC;CACF,CAAA;AAPY,sCAAa;AAIxB;IADC,IAAA,YAAG,GAAE;;;;6CAGL;wBANU,aAAa;IADzB,IAAA,mBAAU,GAAE;qCAE8B,wBAAU;GADxC,aAAa,CAOzB"} |
|
@ -1,2 +0,0 @@ |
|||||||
export declare class AppModule { |
|
||||||
} |
|
@ -1,47 +0,0 @@ |
|||||||
"use strict"; |
|
||||||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { |
|
||||||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; |
|
||||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); |
|
||||||
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; |
|
||||||
return c > 3 && r && Object.defineProperty(target, key, r), r; |
|
||||||
}; |
|
||||||
Object.defineProperty(exports, "__esModule", { value: true }); |
|
||||||
exports.AppModule = void 0; |
|
||||||
const common_1 = require("@nestjs/common"); |
|
||||||
const app_controller_1 = require("./app.controller"); |
|
||||||
const app_service_1 = require("./app.service"); |
|
||||||
const config_1 = require("@nestjs/config"); |
|
||||||
const typeorm_1 = require("@nestjs/typeorm"); |
|
||||||
const path_1 = require("path"); |
|
||||||
const auth_module_1 = require("./auth/auth.module"); |
|
||||||
const users_module_1 = require("./users/users.module"); |
|
||||||
const jwt_1 = require("@nestjs/jwt"); |
|
||||||
let AppModule = class AppModule { |
|
||||||
}; |
|
||||||
exports.AppModule = AppModule; |
|
||||||
exports.AppModule = AppModule = __decorate([ |
|
||||||
(0, common_1.Module)({ |
|
||||||
imports: [ |
|
||||||
config_1.ConfigModule.forRoot({ isGlobal: true }), |
|
||||||
typeorm_1.TypeOrmModule.forRootAsync({ |
|
||||||
imports: [config_1.ConfigModule], |
|
||||||
inject: [config_1.ConfigService], |
|
||||||
useFactory: async (config) => ({ |
|
||||||
type: 'mysql', |
|
||||||
host: config.get('DB_HOST'), |
|
||||||
port: parseInt(config.get('DB_PORT', '3306'), 10), |
|
||||||
username: config.get('DB_USERNAME'), |
|
||||||
password: config.get('DB_PASSWORD'), |
|
||||||
database: config.get('DB_DATABASE'), |
|
||||||
entities: [(0, path_1.join)(__dirname, '**', '*.entity.{ts,js}')], |
|
||||||
synchronize: config.get('NODE_ENV') !== 'production', |
|
||||||
autoLoadEntities: true, |
|
||||||
logging: true, |
|
||||||
}), |
|
||||||
}), auth_module_1.AuthModule, users_module_1.UsersModule |
|
||||||
], |
|
||||||
controllers: [app_controller_1.AppController], |
|
||||||
providers: [app_service_1.AppService, jwt_1.JwtService], |
|
||||||
}) |
|
||||||
], AppModule); |
|
||||||
//# sourceMappingURL=app.module.js.map
|
|
@ -1 +0,0 @@ |
|||||||
{"version":3,"file":"app.module.js","sourceRoot":"","sources":["../src/app.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAwC;AACxC,qDAAiD;AACjD,+CAA2C;AAC3C,2CAA6D;AAC7D,6CAAgD;AAChD,+BAA4B;AAC5B,oDAAgD;AAChD,uDAAmD;AACnD,qCAAyC;AAyBlC,IAAM,SAAS,GAAf,MAAM,SAAS;CAAG,CAAA;AAAZ,8BAAS;oBAAT,SAAS;IAvBrB,IAAA,eAAM,EAAC;QACN,OAAO,EAAE;YACL,qBAAY,CAAC,OAAO,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;YACxC,uBAAa,CAAC,YAAY,CAAC;gBAC3B,OAAO,EAAE,CAAC,qBAAY,CAAC;gBACvB,MAAM,EAAE,CAAC,sBAAa,CAAC;gBACvB,UAAU,EAAE,KAAK,EAAE,MAAqB,EAAE,EAAE,CAAC,CAAC;oBAC5C,IAAI,EAAE,OAAO;oBACb,IAAI,EAAE,MAAM,CAAC,GAAG,CAAS,SAAS,CAAC;oBACnC,IAAI,EAAE,QAAQ,CAAC,MAAM,CAAC,GAAG,CAAS,SAAS,EAAE,MAAM,CAAC,EAAE,EAAE,CAAC;oBACzD,QAAQ,EAAE,MAAM,CAAC,GAAG,CAAS,aAAa,CAAC;oBAC3C,QAAQ,EAAE,MAAM,CAAC,GAAG,CAAS,aAAa,CAAC;oBAC3C,QAAQ,EAAE,MAAM,CAAC,GAAG,CAAS,aAAa,CAAC;oBAC3C,QAAQ,EAAE,CAAC,IAAA,WAAI,EAAC,SAAS,EAAE,IAAI,EAAE,kBAAkB,CAAC,CAAC;oBACrD,WAAW,EAAE,MAAM,CAAC,GAAG,CAAS,UAAU,CAAC,KAAK,YAAY;oBAC5D,gBAAgB,EAAE,IAAI;oBACtB,OAAO,EAAE,IAAI;iBACd,CAAC;aACH,CAAC,EAAE,wBAAU,EAAE,0BAAW;SAC5B;QACD,WAAW,EAAE,CAAC,8BAAa,CAAC;QAC5B,SAAS,EAAE,CAAC,wBAAU,EAAE,gBAAU,CAAC;KACpC,CAAC;GACW,SAAS,CAAG"} |
|
@ -1,3 +0,0 @@ |
|||||||
export declare class AppService { |
|
||||||
getHello(): string; |
|
||||||
} |
|
@ -1,20 +0,0 @@ |
|||||||
"use strict"; |
|
||||||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { |
|
||||||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; |
|
||||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); |
|
||||||
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; |
|
||||||
return c > 3 && r && Object.defineProperty(target, key, r), r; |
|
||||||
}; |
|
||||||
Object.defineProperty(exports, "__esModule", { value: true }); |
|
||||||
exports.AppService = void 0; |
|
||||||
const common_1 = require("@nestjs/common"); |
|
||||||
let AppService = class AppService { |
|
||||||
getHello() { |
|
||||||
return 'Hello World!'; |
|
||||||
} |
|
||||||
}; |
|
||||||
exports.AppService = AppService; |
|
||||||
exports.AppService = AppService = __decorate([ |
|
||||||
(0, common_1.Injectable)() |
|
||||||
], AppService); |
|
||||||
//# sourceMappingURL=app.service.js.map
|
|
@ -1 +0,0 @@ |
|||||||
{"version":3,"file":"app.service.js","sourceRoot":"","sources":["../src/app.service.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAA4C;AAGrC,IAAM,UAAU,GAAhB,MAAM,UAAU;IACrB,QAAQ;QACN,OAAO,cAAc,CAAC;IACxB,CAAC;CACF,CAAA;AAJY,gCAAU;qBAAV,UAAU;IADtB,IAAA,mBAAU,GAAE;GACA,UAAU,CAItB"} |
|
@ -1,15 +0,0 @@ |
|||||||
import { AuthService } from './auth.service'; |
|
||||||
import { CreateUserDto } from 'src/users/dto/create-user.dto'; |
|
||||||
import { LoginUserDto } from 'src/auth/dto/login-user.dto'; |
|
||||||
import { SuccessResponseDto } from 'src/common/dto/sucees-response.dto'; |
|
||||||
import { LoginResponseDto } from './dto/login-response.dto'; |
|
||||||
import { UsersService } from 'src/users/users.service'; |
|
||||||
import { UserInfoResponseDto } from 'src/users/dto/user-info-response.dto'; |
|
||||||
export declare class AuthController { |
|
||||||
private readonly authService; |
|
||||||
private userService; |
|
||||||
constructor(authService: AuthService, userService: UsersService); |
|
||||||
signup(dto: CreateUserDto): Promise<SuccessResponseDto>; |
|
||||||
login(dto: LoginUserDto): Promise<SuccessResponseDto<LoginResponseDto>>; |
|
||||||
getMe(req: any): Promise<SuccessResponseDto<UserInfoResponseDto>>; |
|
||||||
} |
|
@ -1,70 +0,0 @@ |
|||||||
"use strict"; |
|
||||||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { |
|
||||||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; |
|
||||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); |
|
||||||
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; |
|
||||||
return c > 3 && r && Object.defineProperty(target, key, r), r; |
|
||||||
}; |
|
||||||
var __metadata = (this && this.__metadata) || function (k, v) { |
|
||||||
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); |
|
||||||
}; |
|
||||||
var __param = (this && this.__param) || function (paramIndex, decorator) { |
|
||||||
return function (target, key) { decorator(target, key, paramIndex); } |
|
||||||
}; |
|
||||||
Object.defineProperty(exports, "__esModule", { value: true }); |
|
||||||
exports.AuthController = void 0; |
|
||||||
const common_1 = require("@nestjs/common"); |
|
||||||
const auth_service_1 = require("./auth.service"); |
|
||||||
const create_user_dto_1 = require("../users/dto/create-user.dto"); |
|
||||||
const login_user_dto_1 = require("./dto/login-user.dto"); |
|
||||||
const sucees_response_dto_1 = require("../common/dto/sucees-response.dto"); |
|
||||||
const users_service_1 = require("../users/users.service"); |
|
||||||
const jwt_auth_guard_1 = require("./jwt-auth.guard"); |
|
||||||
let AuthController = class AuthController { |
|
||||||
authService; |
|
||||||
userService; |
|
||||||
constructor(authService, userService) { |
|
||||||
this.authService = authService; |
|
||||||
this.userService = userService; |
|
||||||
} |
|
||||||
async signup(dto) { |
|
||||||
const user = await this.authService.signup(dto); |
|
||||||
return sucees_response_dto_1.SuccessResponseDto.ok(); |
|
||||||
} |
|
||||||
async login(dto) { |
|
||||||
const loginUser = await this.authService.login(dto); |
|
||||||
return sucees_response_dto_1.SuccessResponseDto.of(loginUser); |
|
||||||
} |
|
||||||
async getMe(req) { |
|
||||||
const userInfo = await this.userService.findUserInfoByIdOrFail(req.user.userId); |
|
||||||
return sucees_response_dto_1.SuccessResponseDto.of(userInfo); |
|
||||||
} |
|
||||||
}; |
|
||||||
exports.AuthController = AuthController; |
|
||||||
__decorate([ |
|
||||||
(0, common_1.Post)('signup'), |
|
||||||
__param(0, (0, common_1.Body)()), |
|
||||||
__metadata("design:type", Function), |
|
||||||
__metadata("design:paramtypes", [create_user_dto_1.CreateUserDto]), |
|
||||||
__metadata("design:returntype", Promise) |
|
||||||
], AuthController.prototype, "signup", null); |
|
||||||
__decorate([ |
|
||||||
(0, common_1.Post)('login'), |
|
||||||
__param(0, (0, common_1.Body)()), |
|
||||||
__metadata("design:type", Function), |
|
||||||
__metadata("design:paramtypes", [login_user_dto_1.LoginUserDto]), |
|
||||||
__metadata("design:returntype", Promise) |
|
||||||
], AuthController.prototype, "login", null); |
|
||||||
__decorate([ |
|
||||||
(0, common_1.Get)('me'), |
|
||||||
(0, common_1.UseGuards)(jwt_auth_guard_1.JwtAuthGuard), |
|
||||||
__param(0, (0, common_1.Request)()), |
|
||||||
__metadata("design:type", Function), |
|
||||||
__metadata("design:paramtypes", [Object]), |
|
||||||
__metadata("design:returntype", Promise) |
|
||||||
], AuthController.prototype, "getMe", null); |
|
||||||
exports.AuthController = AuthController = __decorate([ |
|
||||||
(0, common_1.Controller)('auth'), |
|
||||||
__metadata("design:paramtypes", [auth_service_1.AuthService, users_service_1.UsersService]) |
|
||||||
], AuthController); |
|
||||||
//# sourceMappingURL=auth.controller.js.map
|
|
@ -1 +0,0 @@ |
|||||||
{"version":3,"file":"auth.controller.js","sourceRoot":"","sources":["../../src/auth/auth.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAAiF;AACjF,iDAA6C;AAC7C,kEAA8D;AAC9D,yDAA2D;AAC3D,2EAAwE;AAExE,0DAAuD;AACvD,qDAAgD;AAIzC,IAAM,cAAc,GAApB,MAAM,cAAc;IACM;IAAkC;IAA/D,YAA6B,WAAwB,EAAU,WAAyB;QAA3D,gBAAW,GAAX,WAAW,CAAa;QAAU,gBAAW,GAAX,WAAW,CAAc;IAAG,CAAC;IAGtF,AAAN,KAAK,CAAC,MAAM,CAAS,GAAkB;QACnC,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;QAChD,OAAO,wCAAkB,CAAC,EAAE,EAAE,CAAC;IACnC,CAAC;IAGK,AAAN,KAAK,CAAC,KAAK,CAAS,GAAiB;QACjC,MAAM,SAAS,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QACpD,OAAO,wCAAkB,CAAC,EAAE,CAAC,SAAS,CAAC,CAAC;IAC5C,CAAC;IAIK,AAAN,KAAK,CAAC,KAAK,CAAY,GAAG;QACtB,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC,sBAAsB,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAChF,OAAO,wCAAkB,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC;IAC3C,CAAC;CACJ,CAAA;AArBY,wCAAc;AAIjB;IADL,IAAA,aAAI,EAAC,QAAQ,CAAC;IACD,WAAA,IAAA,aAAI,GAAE,CAAA;;qCAAM,+BAAa;;4CAGtC;AAGK;IADL,IAAA,aAAI,EAAC,OAAO,CAAC;IACD,WAAA,IAAA,aAAI,GAAE,CAAA;;qCAAM,6BAAY;;2CAGpC;AAIK;IAFL,IAAA,YAAG,EAAC,IAAI,CAAC;IACT,IAAA,kBAAS,EAAC,6BAAY,CAAC;IACX,WAAA,IAAA,gBAAO,GAAE,CAAA;;;;2CAGrB;yBApBQ,cAAc;IAD1B,IAAA,mBAAU,EAAC,MAAM,CAAC;qCAE2B,0BAAW,EAAuB,4BAAY;GAD/E,cAAc,CAqB1B"} |
|
@ -1,2 +0,0 @@ |
|||||||
export declare class AuthModule { |
|
||||||
} |
|
@ -1,42 +0,0 @@ |
|||||||
"use strict"; |
|
||||||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { |
|
||||||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; |
|
||||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); |
|
||||||
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; |
|
||||||
return c > 3 && r && Object.defineProperty(target, key, r), r; |
|
||||||
}; |
|
||||||
Object.defineProperty(exports, "__esModule", { value: true }); |
|
||||||
exports.AuthModule = void 0; |
|
||||||
const common_1 = require("@nestjs/common"); |
|
||||||
const auth_service_1 = require("./auth.service"); |
|
||||||
const auth_controller_1 = require("./auth.controller"); |
|
||||||
const users_module_1 = require("../users/users.module"); |
|
||||||
const jwt_1 = require("@nestjs/jwt"); |
|
||||||
const config_1 = require("@nestjs/config"); |
|
||||||
const passport_1 = require("@nestjs/passport"); |
|
||||||
const jwt_stratedy_1 = require("./jwt.stratedy"); |
|
||||||
let AuthModule = class AuthModule { |
|
||||||
}; |
|
||||||
exports.AuthModule = AuthModule; |
|
||||||
exports.AuthModule = AuthModule = __decorate([ |
|
||||||
(0, common_1.Module)({ |
|
||||||
imports: [ |
|
||||||
users_module_1.UsersModule, |
|
||||||
passport_1.PassportModule, |
|
||||||
config_1.ConfigModule, |
|
||||||
jwt_1.JwtModule.registerAsync({ |
|
||||||
imports: [config_1.ConfigModule], |
|
||||||
inject: [config_1.ConfigService], |
|
||||||
useFactory: async (configService) => ({ |
|
||||||
secret: configService.get('JWT_SECRET'), |
|
||||||
signOptions: { |
|
||||||
expiresIn: configService.get('JWT_EXPIRES_IN') || '1h', |
|
||||||
}, |
|
||||||
}), |
|
||||||
}) |
|
||||||
], |
|
||||||
providers: [auth_service_1.AuthService, jwt_stratedy_1.JwtStrategy], |
|
||||||
controllers: [auth_controller_1.AuthController] |
|
||||||
}) |
|
||||||
], AuthModule); |
|
||||||
//# sourceMappingURL=auth.module.js.map
|
|
@ -1 +0,0 @@ |
|||||||
{"version":3,"file":"auth.module.js","sourceRoot":"","sources":["../../src/auth/auth.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAwC;AACxC,iDAA6C;AAC7C,uDAAmD;AACnD,wDAAqD;AACrD,qCAAwC;AACxC,2CAA6D;AAC7D,+CAAkD;AAClD,iDAA6C;AAqBtC,IAAM,UAAU,GAAhB,MAAM,UAAU;CAAG,CAAA;AAAb,gCAAU;qBAAV,UAAU;IAnBtB,IAAA,eAAM,EAAC;QACN,OAAO,EAAE;YACP,0BAAW;YACX,yBAAc;YACd,qBAAY;YACZ,eAAS,CAAC,aAAa,CAAC;gBACtB,OAAO,EAAE,CAAC,qBAAY,CAAC;gBACvB,MAAM,EAAE,CAAC,sBAAa,CAAC;gBACvB,UAAU,EAAE,KAAK,EAAE,aAA4B,EAAE,EAAE,CAAC,CAAC;oBACnD,MAAM,EAAE,aAAa,CAAC,GAAG,CAAS,YAAY,CAAC;oBAC/C,WAAW,EAAE;wBACX,SAAS,EAAE,aAAa,CAAC,GAAG,CAAS,gBAAgB,CAAC,IAAI,IAAI;qBAC/D;iBACF,CAAC;aACH,CAAC;SACH;QACD,SAAS,EAAE,CAAC,0BAAW,EAAE,0BAAW,CAAC;QACrC,WAAW,EAAE,CAAC,gCAAc,CAAC;KAC9B,CAAC;GACW,UAAU,CAAG"} |
|
@ -1,12 +0,0 @@ |
|||||||
import { JwtService } from '@nestjs/jwt'; |
|
||||||
import { UsersService } from 'src/users/users.service'; |
|
||||||
import { LoginUserDto } from 'src/auth/dto/login-user.dto'; |
|
||||||
import { CreateUserDto } from 'src/users/dto/create-user.dto'; |
|
||||||
import { LoginResponseDto } from './dto/login-response.dto'; |
|
||||||
export declare class AuthService { |
|
||||||
private userService; |
|
||||||
private jwtService; |
|
||||||
constructor(userService: UsersService, jwtService: JwtService); |
|
||||||
signup(dto: CreateUserDto): Promise<import("../users/user.entity").User>; |
|
||||||
login(dto: LoginUserDto): Promise<LoginResponseDto>; |
|
||||||
} |
|
@ -1,49 +0,0 @@ |
|||||||
"use strict"; |
|
||||||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { |
|
||||||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; |
|
||||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); |
|
||||||
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; |
|
||||||
return c > 3 && r && Object.defineProperty(target, key, r), r; |
|
||||||
}; |
|
||||||
var __metadata = (this && this.__metadata) || function (k, v) { |
|
||||||
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); |
|
||||||
}; |
|
||||||
Object.defineProperty(exports, "__esModule", { value: true }); |
|
||||||
exports.AuthService = void 0; |
|
||||||
const common_1 = require("@nestjs/common"); |
|
||||||
const jwt_1 = require("@nestjs/jwt"); |
|
||||||
const users_service_1 = require("../users/users.service"); |
|
||||||
const bcrypt = require("bcrypt"); |
|
||||||
let AuthService = class AuthService { |
|
||||||
userService; |
|
||||||
jwtService; |
|
||||||
constructor(userService, jwtService) { |
|
||||||
this.userService = userService; |
|
||||||
this.jwtService = jwtService; |
|
||||||
} |
|
||||||
async signup(dto) { |
|
||||||
const hashed = await bcrypt.hash(dto.password, 10); |
|
||||||
return this.userService.create({ ...dto, password: hashed }); |
|
||||||
} |
|
||||||
async login(dto) { |
|
||||||
const user = await this.userService.findByName(dto.name); |
|
||||||
if (!user || !await bcrypt.compare(dto.password, user.password)) |
|
||||||
throw new common_1.UnauthorizedException('Login failed'); |
|
||||||
const payload = { username: user.name, sub: user.id }; |
|
||||||
const token = this.jwtService.sign(payload); |
|
||||||
return { |
|
||||||
access_token: token, |
|
||||||
user: { |
|
||||||
id: user.id, |
|
||||||
name: user.name, |
|
||||||
email: user.email, |
|
||||||
} |
|
||||||
}; |
|
||||||
} |
|
||||||
}; |
|
||||||
exports.AuthService = AuthService; |
|
||||||
exports.AuthService = AuthService = __decorate([ |
|
||||||
(0, common_1.Injectable)(), |
|
||||||
__metadata("design:paramtypes", [users_service_1.UsersService, jwt_1.JwtService]) |
|
||||||
], AuthService); |
|
||||||
//# sourceMappingURL=auth.service.js.map
|
|
@ -1 +0,0 @@ |
|||||||
{"version":3,"file":"auth.service.js","sourceRoot":"","sources":["../../src/auth/auth.service.ts"],"names":[],"mappings":";;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E;qCAEwB,4BAAY,EAAsB,gBAAU;GADpE,WAAW,CAwBvB"} |
|
@ -1,5 +0,0 @@ |
|||||||
import { UserInfoResponseDto } from "src/users/dto/user-info-response.dto"; |
|
||||||
export declare class LoginResponseDto { |
|
||||||
access_token: string; |
|
||||||
user: UserInfoResponseDto; |
|
||||||
} |
|
@ -1,9 +0,0 @@ |
|||||||
"use strict"; |
|
||||||
Object.defineProperty(exports, "__esModule", { value: true }); |
|
||||||
exports.LoginResponseDto = void 0; |
|
||||||
class LoginResponseDto { |
|
||||||
access_token; |
|
||||||
user; |
|
||||||
} |
|
||||||
exports.LoginResponseDto = LoginResponseDto; |
|
||||||
//# sourceMappingURL=login-response.dto.js.map
|
|
@ -1 +0,0 @@ |
|||||||
{"version":3,"file":"login-response.dto.js","sourceRoot":"","sources":["../../../src/auth/dto/login-response.dto.ts"],"names":[],"mappings":";;;AAEA,MAAa,gBAAgB;IACzB,YAAY,CAAS;IACrB,IAAI,CAAsB;CAC7B;AAHD,4CAGC"} |
|
@ -1,4 +0,0 @@ |
|||||||
export declare class LoginUserDto { |
|
||||||
readonly name: string; |
|
||||||
readonly password: string; |
|
||||||
} |
|
@ -1,28 +0,0 @@ |
|||||||
"use strict"; |
|
||||||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { |
|
||||||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; |
|
||||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); |
|
||||||
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; |
|
||||||
return c > 3 && r && Object.defineProperty(target, key, r), r; |
|
||||||
}; |
|
||||||
var __metadata = (this && this.__metadata) || function (k, v) { |
|
||||||
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); |
|
||||||
}; |
|
||||||
Object.defineProperty(exports, "__esModule", { value: true }); |
|
||||||
exports.LoginUserDto = void 0; |
|
||||||
const class_validator_1 = require("class-validator"); |
|
||||||
class LoginUserDto { |
|
||||||
name; |
|
||||||
password; |
|
||||||
} |
|
||||||
exports.LoginUserDto = LoginUserDto; |
|
||||||
__decorate([ |
|
||||||
(0, class_validator_1.IsString)(), |
|
||||||
__metadata("design:type", String) |
|
||||||
], LoginUserDto.prototype, "name", void 0); |
|
||||||
__decorate([ |
|
||||||
(0, class_validator_1.IsString)(), |
|
||||||
(0, class_validator_1.MinLength)(4), |
|
||||||
__metadata("design:type", String) |
|
||||||
], LoginUserDto.prototype, "password", void 0); |
|
||||||
//# sourceMappingURL=login-user.dto.js.map
|
|
@ -1 +0,0 @@ |
|||||||
{"version":3,"file":"login-user.dto.js","sourceRoot":"","sources":["../../../src/auth/dto/login-user.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAAsD;AAEtD,MAAa,YAAY;IAEZ,IAAI,CAAS;IAIb,QAAQ,CAAS;CAC7B;AAPD,oCAOC;AALY;IADR,IAAA,0BAAQ,GAAE;;0CACW;AAIb;IAFR,IAAA,0BAAQ,GAAE;IACV,IAAA,2BAAS,EAAC,CAAC,CAAC;;8CACa"} |
|
@ -1,4 +0,0 @@ |
|||||||
declare const JwtAuthGuard_base: import("@nestjs/passport").Type<import("@nestjs/passport").IAuthGuard>; |
|
||||||
export declare class JwtAuthGuard extends JwtAuthGuard_base { |
|
||||||
} |
|
||||||
export {}; |
|
@ -1,18 +0,0 @@ |
|||||||
"use strict"; |
|
||||||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { |
|
||||||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; |
|
||||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); |
|
||||||
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; |
|
||||||
return c > 3 && r && Object.defineProperty(target, key, r), r; |
|
||||||
}; |
|
||||||
Object.defineProperty(exports, "__esModule", { value: true }); |
|
||||||
exports.JwtAuthGuard = void 0; |
|
||||||
const common_1 = require("@nestjs/common"); |
|
||||||
const passport_1 = require("@nestjs/passport"); |
|
||||||
let JwtAuthGuard = class JwtAuthGuard extends (0, passport_1.AuthGuard)('jwt') { |
|
||||||
}; |
|
||||||
exports.JwtAuthGuard = JwtAuthGuard; |
|
||||||
exports.JwtAuthGuard = JwtAuthGuard = __decorate([ |
|
||||||
(0, common_1.Injectable)() |
|
||||||
], JwtAuthGuard); |
|
||||||
//# sourceMappingURL=jwt-auth.guard.js.map
|
|
@ -1 +0,0 @@ |
|||||||
{"version":3,"file":"jwt-auth.guard.js","sourceRoot":"","sources":["../../src/auth/jwt-auth.guard.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAA4C;AAC5C,+CAA6C;AAGtC,IAAM,YAAY,GAAlB,MAAM,YAAa,SAAQ,IAAA,oBAAS,EAAC,KAAK,CAAC;CAAG,CAAA;AAAxC,oCAAY;uBAAZ,YAAY;IADxB,IAAA,mBAAU,GAAE;GACA,YAAY,CAA4B"} |
|
@ -1,10 +0,0 @@ |
|||||||
import { ConfigService } from '@nestjs/config'; |
|
||||||
declare const JwtStrategy_base: new (...args: any) => any; |
|
||||||
export declare class JwtStrategy extends JwtStrategy_base { |
|
||||||
constructor(config: ConfigService); |
|
||||||
validate(payload: any): Promise<{ |
|
||||||
userId: any; |
|
||||||
username: any; |
|
||||||
}>; |
|
||||||
} |
|
||||||
export {}; |
|
@ -1,34 +0,0 @@ |
|||||||
"use strict"; |
|
||||||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { |
|
||||||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; |
|
||||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); |
|
||||||
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; |
|
||||||
return c > 3 && r && Object.defineProperty(target, key, r), r; |
|
||||||
}; |
|
||||||
var __metadata = (this && this.__metadata) || function (k, v) { |
|
||||||
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); |
|
||||||
}; |
|
||||||
Object.defineProperty(exports, "__esModule", { value: true }); |
|
||||||
exports.JwtStrategy = void 0; |
|
||||||
const common_1 = require("@nestjs/common"); |
|
||||||
const passport_1 = require("@nestjs/passport"); |
|
||||||
const passport_jwt_1 = require("passport-jwt"); |
|
||||||
const config_1 = require("@nestjs/config"); |
|
||||||
let JwtStrategy = class JwtStrategy extends (0, passport_1.PassportStrategy)(passport_jwt_1.Strategy) { |
|
||||||
constructor(config) { |
|
||||||
super({ |
|
||||||
jwtFromRequest: passport_jwt_1.ExtractJwt.fromAuthHeaderAsBearerToken(), |
|
||||||
ignoreExpiration: false, |
|
||||||
secretOrKey: config.get('JWT_SECRET'), |
|
||||||
}); |
|
||||||
} |
|
||||||
async validate(payload) { |
|
||||||
return { userId: payload.sub, username: payload.username }; |
|
||||||
} |
|
||||||
}; |
|
||||||
exports.JwtStrategy = JwtStrategy; |
|
||||||
exports.JwtStrategy = JwtStrategy = __decorate([ |
|
||||||
(0, common_1.Injectable)(), |
|
||||||
__metadata("design:paramtypes", [config_1.ConfigService]) |
|
||||||
], JwtStrategy); |
|
||||||
//# sourceMappingURL=jwt.stratedy.js.map
|
|
@ -1 +0,0 @@ |
|||||||
{"version":3,"file":"jwt.stratedy.js","sourceRoot":"","sources":["../../src/auth/jwt.stratedy.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAC5C,+CAAoD;AACpD,+CAAoD;AACpD,2CAA+C;AAGxC,IAAM,WAAW,GAAjB,MAAM,WAAY,SAAQ,IAAA,2BAAgB,EAAC,uBAAQ,CAAC;IACzD,YAAY,MAAqB;QAC/B,KAAK,CAAC;YACJ,cAAc,EAAE,yBAAU,CAAC,2BAA2B,EAAE;YACxD,gBAAgB,EAAE,KAAK;YACvB,WAAW,EAAE,MAAM,CAAC,GAAG,CAAS,YAAY,CAAC;SAC9C,CAAC,CAAC;IACL,CAAC;IAED,KAAK,CAAC,QAAQ,CAAC,OAAY;QACzB,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,GAAG,EAAE,QAAQ,EAAE,OAAO,CAAC,QAAQ,EAAE,CAAC;IAC7D,CAAC;CACF,CAAA;AAZY,kCAAW;sBAAX,WAAW;IADvB,IAAA,mBAAU,GAAE;qCAES,sBAAa;GADtB,WAAW,CAYvB"} |
|
@ -1,7 +0,0 @@ |
|||||||
export declare class SuccessResponseDto<T = any> { |
|
||||||
success: boolean; |
|
||||||
message?: string; |
|
||||||
data?: T; |
|
||||||
static of<T>(data: T, message?: string): SuccessResponseDto<T>; |
|
||||||
static ok(message?: string): SuccessResponseDto<null>; |
|
||||||
} |
|
@ -1,23 +0,0 @@ |
|||||||
"use strict"; |
|
||||||
Object.defineProperty(exports, "__esModule", { value: true }); |
|
||||||
exports.SuccessResponseDto = void 0; |
|
||||||
class SuccessResponseDto { |
|
||||||
success; |
|
||||||
message; |
|
||||||
data; |
|
||||||
static of(data, message) { |
|
||||||
return { |
|
||||||
success: true, |
|
||||||
data, |
|
||||||
message, |
|
||||||
}; |
|
||||||
} |
|
||||||
static ok(message) { |
|
||||||
return { |
|
||||||
success: true, |
|
||||||
message, |
|
||||||
}; |
|
||||||
} |
|
||||||
} |
|
||||||
exports.SuccessResponseDto = SuccessResponseDto; |
|
||||||
//# sourceMappingURL=sucees-response.dto.js.map
|
|
@ -1 +0,0 @@ |
|||||||
{"version":3,"file":"sucees-response.dto.js","sourceRoot":"","sources":["../../../src/common/dto/sucees-response.dto.ts"],"names":[],"mappings":";;;AAAA,MAAa,kBAAkB;IAC3B,OAAO,CAAU;IACjB,OAAO,CAAU;IACjB,IAAI,CAAK;IAET,MAAM,CAAC,EAAE,CAAI,IAAO,EAAE,OAAgB;QAClC,OAAO;YACH,OAAO,EAAE,IAAI;YACb,IAAI;YACJ,OAAO;SACV,CAAC;IACN,CAAC;IAED,MAAM,CAAC,EAAE,CAAC,OAAgB;QACtB,OAAO;YACH,OAAO,EAAE,IAAI;YACb,OAAO;SACV,CAAC;IACN,CAAC;CACJ;AAnBD,gDAmBC"} |
|
@ -1,4 +0,0 @@ |
|||||||
export declare abstract class TimestampedEntity { |
|
||||||
createdAt: Date; |
|
||||||
updatedAt: Date; |
|
||||||
} |
|
@ -1,27 +0,0 @@ |
|||||||
"use strict"; |
|
||||||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { |
|
||||||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; |
|
||||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); |
|
||||||
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; |
|
||||||
return c > 3 && r && Object.defineProperty(target, key, r), r; |
|
||||||
}; |
|
||||||
var __metadata = (this && this.__metadata) || function (k, v) { |
|
||||||
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); |
|
||||||
}; |
|
||||||
Object.defineProperty(exports, "__esModule", { value: true }); |
|
||||||
exports.TimestampedEntity = void 0; |
|
||||||
const typeorm_1 = require("typeorm"); |
|
||||||
class TimestampedEntity { |
|
||||||
createdAt; |
|
||||||
updatedAt; |
|
||||||
} |
|
||||||
exports.TimestampedEntity = TimestampedEntity; |
|
||||||
__decorate([ |
|
||||||
(0, typeorm_1.CreateDateColumn)({ type: 'timestamp' }), |
|
||||||
__metadata("design:type", Date) |
|
||||||
], TimestampedEntity.prototype, "createdAt", void 0); |
|
||||||
__decorate([ |
|
||||||
(0, typeorm_1.UpdateDateColumn)({ type: 'timestamp' }), |
|
||||||
__metadata("design:type", Date) |
|
||||||
], TimestampedEntity.prototype, "updatedAt", void 0); |
|
||||||
//# sourceMappingURL=timestamped.entity.js.map
|
|
@ -1 +0,0 @@ |
|||||||
{"version":3,"file":"timestamped.entity.js","sourceRoot":"","sources":["../../../src/common/entities/timestamped.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAA6D;AAE7D,MAAsB,iBAAiB;IAEnC,SAAS,CAAO;IAGhB,SAAS,CAAO;CACnB;AAND,8CAMC;AAJG;IADC,IAAA,0BAAgB,EAAC,EAAE,IAAI,EAAE,WAAW,EAAE,CAAC;8BAC7B,IAAI;oDAAC;AAGhB;IADC,IAAA,0BAAgB,EAAC,EAAE,IAAI,EAAE,WAAW,EAAE,CAAC;8BAC7B,IAAI;oDAAC"} |
|
@ -1 +0,0 @@ |
|||||||
export {}; |
|
@ -1,17 +0,0 @@ |
|||||||
"use strict"; |
|
||||||
Object.defineProperty(exports, "__esModule", { value: true }); |
|
||||||
const core_1 = require("@nestjs/core"); |
|
||||||
const app_module_1 = require("./app.module"); |
|
||||||
const common_1 = require("@nestjs/common"); |
|
||||||
async function bootstrap() { |
|
||||||
const app = await core_1.NestFactory.create(app_module_1.AppModule); |
|
||||||
app.enableCors(); |
|
||||||
app.useGlobalPipes(new common_1.ValidationPipe({ |
|
||||||
whitelist: true, |
|
||||||
forbidNonWhitelisted: true, |
|
||||||
transform: true, |
|
||||||
})); |
|
||||||
await app.listen(process.env.PORT ?? 3000); |
|
||||||
} |
|
||||||
bootstrap(); |
|
||||||
//# sourceMappingURL=main.js.map
|
|
@ -1 +0,0 @@ |
|||||||
{"version":3,"file":"main.js","sourceRoot":"","sources":["../src/main.ts"],"names":[],"mappings":";;AAAA,uCAA2C;AAC3C,6CAAyC;AACzC,2CAAgD;AAEhD,KAAK,UAAU,SAAS;IACtB,MAAM,GAAG,GAAG,MAAM,kBAAW,CAAC,MAAM,CAAC,sBAAS,CAAC,CAAC;IAChD,GAAG,CAAC,UAAU,EAAE,CAAC;IACjB,GAAG,CAAC,cAAc,CAChB,IAAI,uBAAc,CAAC;QACjB,SAAS,EAAE,IAAI;QACf,oBAAoB,EAAE,IAAI;QAC1B,SAAS,EAAE,IAAI;KAChB,CAAC,CACH,CAAA;IACD,MAAM,GAAG,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,IAAI,IAAI,CAAC,CAAC;AAC7C,CAAC;AACD,SAAS,EAAE,CAAC"} |
|
File diff suppressed because one or more lines are too long
@ -1,4 +0,0 @@ |
|||||||
export declare class ChangePasswordDto { |
|
||||||
readonly currentPassword: string; |
|
||||||
readonly newPassword: string; |
|
||||||
} |
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue