Les sessions foncitonnent, reste à pouvoir les sauvegarder, soit via redis ou via type orm. Pour l'instant redis est un échec

This commit is contained in:
batche
2022-11-03 18:35:46 +01:00
parent 4622792534
commit 03b90690ce
1251 changed files with 35313 additions and 115 deletions

View File

@@ -1,10 +1,10 @@
import { AuthenticationService } from './authentication.service';
import { Response } from 'express';
export declare class AuthenticationController {
private readonly authService;
private authService;
constructor(authService: AuthenticationService);
login(): void;
redirect(res: Response): void;
redirect(response: Response): Promise<void>;
status(): string;
logout(): string;
}

View File

@@ -14,7 +14,7 @@ var __param = (this && this.__param) || function (paramIndex, decorator) {
Object.defineProperty(exports, "__esModule", { value: true });
exports.AuthenticationController = void 0;
const common_1 = require("@nestjs/common");
const guards_1 = require("./guards/guards");
const _42guards_1 = require("./guards/42guards");
const authentication_service_1 = require("./authentication.service");
let AuthenticationController = class AuthenticationController {
constructor(authService) {
@@ -23,9 +23,8 @@ let AuthenticationController = class AuthenticationController {
login() {
return;
}
redirect(res) {
console.log(`Redirection performed`);
res.sendStatus(200);
async redirect(response) {
response.send(200);
}
status() {
return 'status';
@@ -35,22 +34,23 @@ let AuthenticationController = class AuthenticationController {
}
};
__decorate([
(0, common_1.Get)('login'),
(0, common_1.UseGuards)(guards_1.FortyTwoAuthGuard),
(0, common_1.Get)(),
(0, common_1.UseGuards)(_42guards_1.FortyTwoAuthGuard),
__metadata("design:type", Function),
__metadata("design:paramtypes", []),
__metadata("design:returntype", void 0)
], AuthenticationController.prototype, "login", null);
__decorate([
(0, common_1.Get)('redirect'),
(0, common_1.UseGuards)(guards_1.FortyTwoAuthGuard),
(0, common_1.UseGuards)(_42guards_1.FortyTwoAuthGuard),
__param(0, (0, common_1.Res)()),
__metadata("design:type", Function),
__metadata("design:paramtypes", [Object]),
__metadata("design:returntype", void 0)
__metadata("design:returntype", Promise)
], AuthenticationController.prototype, "redirect", null);
__decorate([
(0, common_1.Get)('status'),
(0, common_1.UseGuards)(_42guards_1.AuthenticateGuard),
__metadata("design:type", Function),
__metadata("design:paramtypes", []),
__metadata("design:returntype", void 0)

View File

@@ -1 +1 @@
{"version":3,"file":"authentication.controller.js","sourceRoot":"","sources":["../../../src/auth/42/authentication.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAAiE;AACjE,4CAAoD;AACpD,qEAAiE;AAI1D,IAAM,wBAAwB,GAA9B,MAAM,wBAAwB;IAEpC,YAA6B,WAAkC;QAAlC,gBAAW,GAAX,WAAW,CAAuB;IAAG,CAAC;IAQnE,KAAK;QACJ,OAAO;IACR,CAAC;IASD,QAAQ,CAAQ,GAAa;QAC5B,OAAO,CAAC,GAAG,CAAC,uBAAuB,CAAC,CAAC;QACrC,GAAG,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;IACrB,CAAC;IAQD,MAAM;QACL,OAAO,QAAQ,CAAC;IACjB,CAAC;IAOD,MAAM;QACL,OAAO,QAAQ,CAAC;IACjB,CAAC;CACD,CAAA;AApCA;IAAC,IAAA,YAAG,EAAC,OAAO,CAAC;IACZ,IAAA,kBAAS,EAAC,0BAAiB,CAAC;;;;qDAG5B;AAOD;IAAC,IAAA,YAAG,EAAC,UAAU,CAAC;IACf,IAAA,kBAAS,EAAC,0BAAiB,CAAC;IACnB,WAAA,IAAA,YAAG,GAAE,CAAA;;;;wDAGd;AAOD;IAAC,IAAA,YAAG,EAAC,QAAQ,CAAC;;;;sDAGb;AAMD;IAAC,IAAA,YAAG,EAAC,QAAQ,CAAC;;;;sDAGb;AA3CW,wBAAwB;IADpC,IAAA,mBAAU,EAAC,MAAM,CAAC;qCAGwB,8CAAqB;GAFnD,wBAAwB,CA4CpC;AA5CY,4DAAwB"}
{"version":3,"file":"authentication.controller.js","sourceRoot":"","sources":["../../../src/auth/42/authentication.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAAsE;AACtE,iDAAyE;AACzE,qEAAiE;AAK1D,IAAM,wBAAwB,GAA9B,MAAM,wBAAwB;IAEpC,YAAoB,WAAkC;QAAlC,gBAAW,GAAX,WAAW,CAAuB;IAEhD,CAAC;IAQP,KAAK;QACJ,OAAQ;IACT,CAAC;IASK,AAAN,KAAK,CAAC,QAAQ,CAAQ,QAAmB;QACxC,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACpB,CAAC;IASD,MAAM;QACL,OAAO,QAAQ,CAAC;IACjB,CAAC;IAOD,MAAM;QACL,OAAO,QAAQ,CAAC;IACjB,CAAC;CACD,CAAA;AApCA;IAAC,IAAA,YAAG,GAAE;IACL,IAAA,kBAAS,EAAC,6BAAiB,CAAC;;;;qDAG5B;AASK;IAFL,IAAA,YAAG,EAAC,UAAU,CAAC;IACf,IAAA,kBAAS,EAAC,6BAAiB,CAAC;IACb,WAAA,IAAA,YAAG,GAAE,CAAA;;;;wDAEpB;AAOD;IAAC,IAAA,YAAG,EAAC,QAAQ,CAAC;IACb,IAAA,kBAAS,EAAC,6BAAiB,CAAC;;;;sDAG5B;AAMD;IAAC,IAAA,YAAG,EAAC,QAAQ,CAAC;;;;sDAGb;AA7CW,wBAAwB;IADpC,IAAA,mBAAU,EAAC,MAAM,CAAC;qCAGe,8CAAqB;GAF1C,wBAAwB,CA8CpC;AA9CY,4DAAwB"}

View File

@@ -15,14 +15,16 @@ const users_module_1 = require("../../users/users.module");
const users_service_1 = require("../../users/users.service");
const authentication_controller_1 = require("./authentication.controller");
const authentication_service_1 = require("./authentication.service");
const strategy_1 = require("./strategy/strategy");
const _42strategy_1 = require("./strategy/42strategy");
const serializer_1 = require("./utils/serializer");
let AuthenticationModule = class AuthenticationModule {
};
AuthenticationModule = __decorate([
(0, common_1.Module)({
imports: [typeorm_1.TypeOrmModule.forFeature([user_entity_1.User, friendship_entity_1.Friendship]), users_module_1.UsersModule],
providers: [authentication_service_1.AuthenticationService, strategy_1.FortyTwoStrategy, users_service_1.UsersService, serializer_1.SessionSerializer],
imports: [typeorm_1.TypeOrmModule.forFeature([user_entity_1.User, friendship_entity_1.Friendship]), users_module_1.UsersModule,
],
providers: [authentication_service_1.AuthenticationService, _42strategy_1.FortyTwoStrategy, users_service_1.UsersService, serializer_1.SessionSerializer,
],
exports: [authentication_service_1.AuthenticationService],
controllers: [authentication_controller_1.AuthenticationController],
})

View File

@@ -1 +1 @@
{"version":3,"file":"authentication.module.js","sourceRoot":"","sources":["../../../src/auth/42/authentication.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAwC;AACxC,6CAAgD;AAChD,mFAAuE;AACvE,kEAAsD;AACtD,2DAAqD;AACrD,6DAAuD;AACvD,2EAAuE;AACvE,qEAAiE;AACjE,kDAAuD;AACvD,mDAAuD;AAQhD,IAAM,oBAAoB,GAA1B,MAAM,oBAAoB;CAAG,CAAA;AAAvB,oBAAoB;IANhC,IAAA,eAAM,EAAC;QACL,OAAO,EAAE,CAAC,uBAAa,CAAC,UAAU,CAAC,CAAC,kBAAI,EAAE,8BAAU,CAAC,CAAC,EAAE,0BAAW,CAAC;QACpE,SAAS,EAAE,CAAC,8CAAqB,EAAE,2BAAgB,EAAE,4BAAY,EAAE,8BAAiB,CAAC;QACrF,OAAO,EAAE,CAAC,8CAAqB,CAAC;QAChC,WAAW,EAAE,CAAC,oDAAwB,CAAC;KACzC,CAAC;GACW,oBAAoB,CAAG;AAAvB,oDAAoB"}
{"version":3,"file":"authentication.module.js","sourceRoot":"","sources":["../../../src/auth/42/authentication.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAwC;AAGxC,6CAAgD;AAChD,mFAAuE;AACvE,kEAAsD;AACtD,2DAAqD;AACrD,6DAAuD;AACvD,2EAAuE;AACvE,qEAAiE;AACjE,uDAAyD;AAEzD,mDAAuD;AAmBhD,IAAM,oBAAoB,GAA1B,MAAM,oBAAoB;CAAG,CAAA;AAAvB,oBAAoB;IAjBhC,IAAA,eAAM,EAAC;QACL,OAAO,EAAE,CAAC,uBAAa,CAAC,UAAU,CAAC,CAAC,kBAAI,EAAE,8BAAU,CAAC,CAAC,EAAE,0BAAW;SASpE;QACC,SAAS,EAAE,CAAC,8CAAqB,EAAE,8BAAgB,EAAE,4BAAY,EAAE,8BAAiB;SAEtF;QACE,OAAO,EAAE,CAAC,8CAAqB,CAAC;QAChC,WAAW,EAAE,CAAC,oDAAwB,CAAC;KACzC,CAAC;GACW,oBAAoB,CAAG;AAAvB,oDAAoB"}

View File

@@ -1 +1 @@
{"version":3,"file":"authentication.service.js","sourceRoot":"","sources":["../../../src/auth/42/authentication.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAK5C,6DAAuD;AAGhD,IAAM,qBAAqB,GAA3B,MAAM,qBAAqB;IACjC,YACmB,WAAyB;QAAzB,gBAAW,GAAX,WAAW,CAAc;IACxC,CAAC;IAEL,KAAK,CAAC,YAAY,CAAC,cAA8B;QAChD,OAAO,CAAC,GAAG,CAAC,2CAA2C,CAAC,CAAC;QACzD,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC,oBAAoB,CAAC,cAAc,CAAC,WAAW,CAAC,CAAC;QACrF,IAAI,IAAI;YACP,OAAO,IAAI,CAAC;QACb,OAAO,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC;IAChD,CAAC;IAED,KAAK,CAAC,QAAQ,CAAC,YAAqB;QACnC,OAAO,MAAM,IAAI,CAAC,WAAW,CAAC,oBAAoB,CAAC,YAAY,CAAC,CAAC;IAClE,CAAC;CAED,CAAA;AAjBY,qBAAqB;IADjC,IAAA,mBAAU,GAAE;qCAGoB,4BAAY;GAFhC,qBAAqB,CAiBjC;AAjBY,sDAAqB"}
{"version":3,"file":"authentication.service.js","sourceRoot":"","sources":["../../../src/auth/42/authentication.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAG5C,6DAAuD;AAIhD,IAAM,qBAAqB,GAA3B,MAAM,qBAAqB;IACjC,YACmB,WAAyB;QAAzB,gBAAW,GAAX,WAAW,CAAc;IAExC,CAAC;IAEL,KAAK,CAAC,YAAY,CAAC,cAA8B;QAChD,OAAO,CAAC,GAAG,CAAC,2CAA2C,CAAC,CAAC;QACzD,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC,oBAAoB,CAAC,cAAc,CAAC,WAAW,CAAC,CAAC;QACrF,IAAI,IAAI;YACP,OAAO,IAAI,CAAC;QACb,OAAO,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC;IAChD,CAAC;IAED,KAAK,CAAC,QAAQ,CAAC,YAAqB;QACnC,OAAO,MAAM,IAAI,CAAC,WAAW,CAAC,oBAAoB,CAAC,YAAY,CAAC,CAAC;IAClE,CAAC;CAMD,CAAA;AAtBY,qBAAqB;IADjC,IAAA,mBAAU,GAAE;qCAGoB,4BAAY;GAFhC,qBAAqB,CAsBjC;AAtBY,sDAAqB"}

View File

@@ -0,0 +1,6 @@
import { ExecutionContext } from "@nestjs/common";
declare const FortyTwoAuthGuard_base: import("@nestjs/passport").Type<import("@nestjs/passport").IAuthGuard>;
export declare class FortyTwoAuthGuard extends FortyTwoAuthGuard_base {
canActivate(context: ExecutionContext): Promise<any>;
}
export {};

View File

@@ -0,0 +1,24 @@
"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.FortyTwoAuthGuard = void 0;
const common_1 = require("@nestjs/common");
const passport_1 = require("@nestjs/passport");
let FortyTwoAuthGuard = class FortyTwoAuthGuard extends (0, passport_1.AuthGuard)('42') {
async canActivate(context) {
const activate = (await super.canActivate(context));
const request = context.switchToHttp().getRequest();
await super.logIn(request);
return activate;
}
};
FortyTwoAuthGuard = __decorate([
(0, common_1.Injectable)()
], FortyTwoAuthGuard);
exports.FortyTwoAuthGuard = FortyTwoAuthGuard;
//# sourceMappingURL=42guards%20copy.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"42guards copy.js","sourceRoot":"","sources":["../../../../src/auth/42/guards/42guards copy.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAA2E;AAC3E,+CAA6C;AAGtC,IAAM,iBAAiB,GAAvB,MAAM,iBAAkB,SAAQ,IAAA,oBAAS,EAAC,IAAI,CAAC;IACrD,KAAK,CAAC,WAAW,CAAC,OAAyB;QAC1C,MAAM,QAAQ,GAAG,CAAC,MAAM,KAAK,CAAC,WAAW,CAAC,OAAO,CAAC,CAAY,CAAC;QAC/D,MAAM,OAAO,GAAG,OAAO,CAAC,YAAY,EAAE,CAAC,UAAU,EAAE,CAAC;QACpD,MAAM,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QAC3B,OAAO,QAAQ,CAAC;IACjB,CAAC;CACD,CAAA;AAPY,iBAAiB;IAD7B,IAAA,mBAAU,GAAE;GACA,iBAAiB,CAO7B;AAPY,8CAAiB"}

View File

@@ -0,0 +1,9 @@
import { CanActivate, ExecutionContext } from "@nestjs/common";
declare const FortyTwoAuthGuard_base: import("@nestjs/passport").Type<import("@nestjs/passport").IAuthGuard>;
export declare class FortyTwoAuthGuard extends FortyTwoAuthGuard_base {
canActivate(context: ExecutionContext): Promise<any>;
}
export declare class AuthenticateGuard implements CanActivate {
canActivate(context: ExecutionContext): Promise<boolean>;
}
export {};

View File

@@ -0,0 +1,35 @@
"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.AuthenticateGuard = exports.FortyTwoAuthGuard = void 0;
const common_1 = require("@nestjs/common");
const passport_1 = require("@nestjs/passport");
let FortyTwoAuthGuard = class FortyTwoAuthGuard extends (0, passport_1.AuthGuard)('42') {
async canActivate(context) {
const activate = (await super.canActivate(context));
const request = context.switchToHttp().getRequest();
await super.logIn(request);
return activate;
}
};
FortyTwoAuthGuard = __decorate([
(0, common_1.Injectable)()
], FortyTwoAuthGuard);
exports.FortyTwoAuthGuard = FortyTwoAuthGuard;
let AuthenticateGuard = class AuthenticateGuard {
async canActivate(context) {
const request = context.switchToHttp().getRequest();
console.log(request.isAuthenticated());
return request.isAuthenticated();
}
};
AuthenticateGuard = __decorate([
(0, common_1.Injectable)()
], AuthenticateGuard);
exports.AuthenticateGuard = AuthenticateGuard;
//# sourceMappingURL=42guards.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"42guards.js","sourceRoot":"","sources":["../../../../src/auth/42/guards/42guards.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAA2E;AAC3E,+CAA6C;AAGtC,IAAM,iBAAiB,GAAvB,MAAM,iBAAkB,SAAQ,IAAA,oBAAS,EAAC,IAAI,CAAC;IACrD,KAAK,CAAC,WAAW,CAAC,OAAyB;QAC1C,MAAM,QAAQ,GAAG,CAAC,MAAM,KAAK,CAAC,WAAW,CAAC,OAAO,CAAC,CAAY,CAAC;QAC/D,MAAM,OAAO,GAAG,OAAO,CAAC,YAAY,EAAE,CAAC,UAAU,EAAE,CAAC;QACpD,MAAM,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QAC3B,OAAO,QAAQ,CAAC;IACjB,CAAC;CACD,CAAA;AAPY,iBAAiB;IAD7B,IAAA,mBAAU,GAAE;GACA,iBAAiB,CAO7B;AAPY,8CAAiB;AAUvB,IAAM,iBAAiB,GAAvB,MAAM,iBAAiB;IAC7B,KAAK,CAAC,WAAW,CAAC,OAAyB;QAC1C,MAAM,OAAO,GAAG,OAAO,CAAC,YAAY,EAAE,CAAC,UAAU,EAAE,CAAC;QACpD,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,eAAe,EAAE,CAAC,CAAC;QACvC,OAAO,OAAO,CAAC,eAAe,EAAE,CAAC;IAClC,CAAC;CACD,CAAA;AANY,iBAAiB;IAD7B,IAAA,mBAAU,GAAE;GACA,iBAAiB,CAM7B;AANY,8CAAiB"}

View File

@@ -0,0 +1,4 @@
declare const JwtAuthGuard_base: import("@nestjs/passport").Type<import("@nestjs/passport").IAuthGuard>;
export declare class JwtAuthGuard extends JwtAuthGuard_base {
}
export {};

View File

@@ -0,0 +1,18 @@
"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') {
};
JwtAuthGuard = __decorate([
(0, common_1.Injectable)()
], JwtAuthGuard);
exports.JwtAuthGuard = JwtAuthGuard;
//# sourceMappingURL=jwtGuards.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"jwtGuards.js","sourceRoot":"","sources":["../../../../src/auth/42/guards/jwtGuards.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAA2E;AAC3E,+CAA6C;AAGtC,IAAM,YAAY,GAAlB,MAAM,YAAa,SAAQ,IAAA,oBAAS,EAAC,KAAK,CAAC;CAAG,CAAA;AAAxC,YAAY;IADxB,IAAA,mBAAU,GAAE;GACA,YAAY,CAA4B;AAAxC,oCAAY"}

View File

@@ -0,0 +1,9 @@
import { Profile } from "passport-42/lib";
import { AuthenticationService } from "../authentication.service";
declare const FortyTwoStrategy_base: new (...args: any[]) => any;
export declare class FortyTwoStrategy extends FortyTwoStrategy_base {
private authenticationService;
constructor(authenticationService: AuthenticationService);
validate(accessToken: string, refreshToken: string, profile: Profile, callbackURL: string): Promise<import("../../../users/entities/user.entity").User>;
}
export {};

View File

@@ -0,0 +1,42 @@
"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.FortyTwoStrategy = void 0;
const lib_1 = require("passport-42/lib");
const passport_1 = require("@nestjs/passport");
const common_1 = require("@nestjs/common");
const authentication_service_1 = require("../authentication.service");
let FortyTwoStrategy = class FortyTwoStrategy extends (0, passport_1.PassportStrategy)(lib_1.Strategy, "42") {
constructor(authenticationService) {
super({
clientID: process.env.FORTYTWO_CLIENT_ID,
clientSecret: process.env.FORTYTWO_CLIENT_SECRET,
callbackURL: process.env.FORTYTWO_CALLBACK_URL,
scope: ["public"],
});
this.authenticationService = authenticationService;
}
async validate(accessToken, refreshToken, profile, callbackURL) {
console.log("Validate inside strategy.ts");
console.log(profile.id, profile.username, profile.phoneNumbers[0].value, profile.emails[0].value, profile.photos[0].value);
const userDTO = { fourtyTwoId: profile.id, username: profile.username, email: profile.emails[0].value, image_url: profile.photos[0].value };
const user = await this.authenticationService.validateUser(userDTO);
if (!user)
throw new common_1.UnauthorizedException();
return user;
}
};
FortyTwoStrategy = __decorate([
(0, common_1.Injectable)(),
__metadata("design:paramtypes", [authentication_service_1.AuthenticationService])
], FortyTwoStrategy);
exports.FortyTwoStrategy = FortyTwoStrategy;
//# sourceMappingURL=42strategy.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"42strategy.js","sourceRoot":"","sources":["../../../../src/auth/42/strategy/42strategy.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,yCAAoD;AACpD,+CAAoD;AACpD,2CAAmE;AACnE,sEAAkE;AAI3D,IAAM,gBAAgB,GAAtB,MAAM,gBAAiB,SAAQ,IAAA,2BAAgB,EAAC,cAAQ,EAAE,IAAI,CAAC;IACrE,YAAoB,qBAA4C;QAChE,KAAK,CAAC;YACJ,QAAQ,EAAE,OAAO,CAAC,GAAG,CAAC,kBAAkB;YACxC,YAAY,EAAE,OAAO,CAAC,GAAG,CAAC,sBAAsB;YAChD,WAAW,EAAE,OAAO,CAAC,GAAG,CAAC,qBAAqB;YAC9C,KAAK,EAAE,CAAC,QAAQ,CAAC;SAClB,CAAC,CAAC;QANiB,0BAAqB,GAArB,qBAAqB,CAAuB;IAO/D,CAAC;IAED,KAAK,CAAC,QAAQ,CAAC,WAAmB,EAAE,YAAoB,EAAE,OAAgB,EAAE,WAAmB;QAChG,OAAO,CAAC,GAAG,CAAC,6BAA6B,CAAC,CAAC;QAC3C,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,EAAE,OAAO,CAAC,QAAQ,EAAE,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,KAAK,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,KAAK,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;QAC3H,MAAM,OAAO,GAAoB,EAAE,WAAW,EAAE,OAAO,CAAC,EAAE,EAAE,QAAQ,EAAE,OAAO,CAAC,QAAQ,EAAE,KAAK,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,KAAK,EAAE,SAAS,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC;QAC7J,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,qBAAqB,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC;QACpE,IAAI,CAAC,IAAI;YACR,MAAM,IAAI,8BAAqB,EAAE,CAAC;QACnC,OAAO,IAAI,CAAC;IACX,CAAC;CACF,CAAA;AAnBY,gBAAgB;IAD5B,IAAA,mBAAU,GAAE;qCAE+B,8CAAqB;GADpD,gBAAgB,CAmB5B;AAnBY,4CAAgB"}

View File

@@ -0,0 +1,13 @@
import { Strategy as PassportJwtStrategy } from "passport-jwt";
import { AuthenticationService } from "../authentication.service";
declare const JwtStrategy_base: new (...args: any[]) => PassportJwtStrategy;
export declare class JwtStrategy extends JwtStrategy_base {
private readonly authenticationService;
constructor(authenticationService: AuthenticationService);
validate(payload: any): Promise<{
fourtyTwoId: any;
username: any;
image_url: any;
}>;
}
export {};

View File

@@ -0,0 +1,39 @@
"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 authentication_service_1 = require("../authentication.service");
let JwtStrategy = class JwtStrategy extends (0, passport_1.PassportStrategy)(passport_jwt_1.Strategy, "jwt") {
constructor(authenticationService) {
super({
jwtFromRequest: passport_jwt_1.ExtractJwt.fromAuthHeaderAsBearerToken(),
ignoreExpiration: false,
secretOrKey: process.env.JWT_SECRET,
});
this.authenticationService = authenticationService;
}
async validate(payload) {
console.log("Validate inside jwtStrategy.ts");
const user = await this.authenticationService.findUser(payload.fourtyTwoId);
if (!user)
throw new common_1.UnauthorizedException('You must be logged in to continue.');
return { fourtyTwoId: payload.fourtyTwoId, username: payload.username, image_url: payload.image_url };
}
};
JwtStrategy = __decorate([
(0, common_1.Injectable)(),
__metadata("design:paramtypes", [authentication_service_1.AuthenticationService])
], JwtStrategy);
exports.JwtStrategy = JwtStrategy;
//# sourceMappingURL=jwtStrategy.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"jwtStrategy.js","sourceRoot":"","sources":["../../../../src/auth/42/strategy/jwtStrategy.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAAmE;AACnE,+CAAoD;AACpD,+CAA2E;AAC3E,sEAAkE;AAI3D,IAAM,WAAW,GAAjB,MAAM,WAAY,SAAQ,IAAA,2BAAgB,EAAC,uBAAmB,EAAE,KAAK,CAAC;IAC5E,YAA6B,qBAA4C;QAExE,KAAK,CAAC;YACL,cAAc,EAAE,yBAAU,CAAC,2BAA2B,EAAE;YACxD,gBAAgB,EAAE,KAAK;YACvB,WAAW,EAAE,OAAO,CAAC,GAAG,CAAC,UAAU;SACnC,CAAC,CAAC;QANyB,0BAAqB,GAArB,qBAAqB,CAAuB;IAOzE,CAAC;IACD,KAAK,CAAC,QAAQ,CAAC,OAAY;QAC1B,OAAO,CAAC,GAAG,CAAC,gCAAgC,CAAC,CAAC;QAC9C,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,qBAAqB,CAAC,QAAQ,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC;QAC5E,IAAI,CAAC,IAAI;YACR,MAAM,IAAI,8BAAqB,CAAC,oCAAoC,CAAC,CAAC;QACvE,OAAO,EAAE,WAAW,EAAE,OAAO,CAAC,WAAW,EAAE,QAAQ,EAAE,OAAO,CAAC,QAAQ,EAAE,SAAS,EAAE,OAAO,CAAC,SAAS,EAAE,CAAC;IACvG,CAAC;CACD,CAAA;AAhBY,WAAW;IADvB,IAAA,mBAAU,GAAE;qCAEwC,8CAAqB;GAD7D,WAAW,CAgBvB;AAhBY,kCAAW"}

View File

@@ -1,3 +1,6 @@
export declare const constants: {
secret: string;
};
export declare const jwt_constants: {
secret: string;
};

View File

@@ -1,7 +1,10 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.constants = void 0;
exports.jwt_constants = exports.constants = void 0;
exports.constants = {
secret: process.env.COOKIE_SECRET,
};
exports.jwt_constants = {
secret: process.env.JWT_SECRET,
};
//# sourceMappingURL=constant.js.map

View File

@@ -1 +1 @@
{"version":3,"file":"constant.js","sourceRoot":"","sources":["../../src/conf/constant.ts"],"names":[],"mappings":";;;AAAa,QAAA,SAAS,GAAG;IACtB,MAAM,EAAE,OAAO,CAAC,GAAG,CAAC,aAAa;CACnC,CAAC"}
{"version":3,"file":"constant.js","sourceRoot":"","sources":["../../src/conf/constant.ts"],"names":[],"mappings":";;;AAAa,QAAA,SAAS,GAAG;IACtB,MAAM,EAAE,OAAO,CAAC,GAAG,CAAC,aAAa;CACnC,CAAC;AAEW,QAAA,aAAa,GAAG;IAC1B,MAAM,EAAE,OAAO,CAAC,GAAG,CAAC,UAAU;CAChC,CAAC"}

View File

@@ -14,7 +14,7 @@ var __param = (this && this.__param) || function (paramIndex, decorator) {
Object.defineProperty(exports, "__esModule", { value: true });
exports.FriendshipController = void 0;
const common_1 = require("@nestjs/common");
const guards_1 = require("../auth/42/guards/guards");
const jwtGuards_1 = require("../auth/42/guards/jwtGuards");
const create_friendship_dto_1 = require("./dto/create-friendship.dto");
const update_friendship_dto_1 = require("./dto/update-friendship.dto");
const friendship_service_1 = require("./friendship.service");
@@ -49,7 +49,7 @@ let FriendshipController = class FriendshipController {
};
__decorate([
(0, common_1.Get)(':userId/friends'),
(0, common_1.UseGuards)(guards_1.FortyTwoAuthGuard),
(0, common_1.UseGuards)(jwtGuards_1.JwtAuthGuard),
__param(0, (0, common_1.Param)('userId')),
__metadata("design:type", Function),
__metadata("design:paramtypes", [String]),
@@ -57,7 +57,7 @@ __decorate([
], FriendshipController.prototype, "findEmpty", null);
__decorate([
(0, common_1.Get)(':userId/blocked'),
(0, common_1.UseGuards)(guards_1.FortyTwoAuthGuard),
(0, common_1.UseGuards)(jwtGuards_1.JwtAuthGuard),
__param(0, (0, common_1.Param)('userId')),
__metadata("design:type", Function),
__metadata("design:paramtypes", [String]),
@@ -65,7 +65,7 @@ __decorate([
], FriendshipController.prototype, "findAllBlocked", null);
__decorate([
(0, common_1.Get)(':userId/pending'),
(0, common_1.UseGuards)(guards_1.FortyTwoAuthGuard),
(0, common_1.UseGuards)(jwtGuards_1.JwtAuthGuard),
__param(0, (0, common_1.Param)('userId')),
__metadata("design:type", Function),
__metadata("design:paramtypes", [String]),
@@ -73,7 +73,7 @@ __decorate([
], FriendshipController.prototype, "findAllPendantFriendshipRequested", null);
__decorate([
(0, common_1.Get)(':userId/received'),
(0, common_1.UseGuards)(guards_1.FortyTwoAuthGuard),
(0, common_1.UseGuards)(jwtGuards_1.JwtAuthGuard),
__param(0, (0, common_1.Param)('userId')),
__metadata("design:type", Function),
__metadata("design:paramtypes", [String]),
@@ -81,7 +81,7 @@ __decorate([
], FriendshipController.prototype, "findAllPendantFriendshipReceived", null);
__decorate([
(0, common_1.Get)(':userId/myfriends/:friendId'),
(0, common_1.UseGuards)(guards_1.FortyTwoAuthGuard),
(0, common_1.UseGuards)(jwtGuards_1.JwtAuthGuard),
__param(0, (0, common_1.Param)('friendId')),
__metadata("design:type", Function),
__metadata("design:paramtypes", [String]),
@@ -90,7 +90,7 @@ __decorate([
__decorate([
(0, common_1.Post)(),
(0, common_1.HttpCode)(common_1.HttpStatus.CREATED),
(0, common_1.UseGuards)(guards_1.FortyTwoAuthGuard),
(0, common_1.UseGuards)(jwtGuards_1.JwtAuthGuard),
__param(0, (0, common_1.Body)()),
__metadata("design:type", Function),
__metadata("design:paramtypes", [create_friendship_dto_1.CreateFriendshipDto]),
@@ -98,7 +98,7 @@ __decorate([
], FriendshipController.prototype, "create", null);
__decorate([
(0, common_1.Patch)(':userId/received/:relationshipId'),
(0, common_1.UseGuards)(guards_1.FortyTwoAuthGuard),
(0, common_1.UseGuards)(jwtGuards_1.JwtAuthGuard),
__param(0, (0, common_1.Param)('friendId')),
__param(1, (0, common_1.Body)()),
__metadata("design:type", Function),
@@ -107,7 +107,7 @@ __decorate([
], FriendshipController.prototype, "update", null);
__decorate([
(0, common_1.Delete)(':userId/:friendId'),
(0, common_1.UseGuards)(guards_1.FortyTwoAuthGuard),
(0, common_1.UseGuards)(jwtGuards_1.JwtAuthGuard),
__param(0, (0, common_1.Param)('friendId')),
__metadata("design:type", Function),
__metadata("design:paramtypes", [String]),

View File

@@ -1 +1 @@
{"version":3,"file":"friendship.controller.js","sourceRoot":"","sources":["../../src/friendship/friendship.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAAmI;AACnI,qDAA8D;AAE9D,uEAAkE;AAClE,uEAAkE;AAElE,6DAAyD;AAGlD,IAAM,oBAAoB,GAA1B,MAAM,oBAAoB;IAChC,YAA6B,iBAAoC;QAApC,sBAAiB,GAAjB,iBAAiB,CAAmB;IAAG,CAAC;IAIrE,SAAS,CAAkB,MAAc;QACxC,OAAO,IAAI,CAAC,iBAAiB,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC;IACtD,CAAC;IAID,cAAc,CAAkB,MAAc;QAC7C,OAAO,IAA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,IAAA,YAAG,EAAC,kBAAkB,CAAC;IACvB,IAAA,kBAAS,EAAC,0BAAiB,CAAC;IACK,WAAA,IAAA,cAAK,EAAC,QAAQ,CAAC,CAAA;;;;4EAEhD;AAED;IAAC,IAAA,YAAG,EAAC,6BAA6B,CAAC;IAClC,IAAA,kBAAS,EAAC,0BAAiB,CAAC;IACd,WAAA,IAAA,cAAK,EAAC,UAAU,CAAC,CAAA;;;;yDAE/B;AAED;IAAC,IAAA,aAAI,GAAE;IACN,IAAA,iBAAQ,EAAC,mBAAU,CAAC,OAAO,CAAC;IAC5B,IAAA,kBAAS,EAAC,0BAAiB,CAAC;IACrB,WAAA,IAAA,aAAI,GAAE,CAAA;;qCAAsB,2CAAmB;;kDAEtD;AAED;IAAC,IAAA,cAAK,EAAC,kCAAkC,CAAC;IACzC,IAAA,kBAAS,EAAC,0BAAiB,CAAC;IACrB,WAAA,IAAA,cAAK,EAAC,UAAU,CAAC,CAAA;IAA0B,WAAA,IAAA,aAAI,GAAE,CAAA;;6CAAW,2CAAmB;;kDAEtF;AAED;IAAC,IAAA,eAAM,EAAC,mBAAmB,CAAC;IAC3B,IAAA,kBAAS,EAAC,0BAAiB,CAAC;IACrB,WAAA,IAAA,cAAK,EAAC,UAAU,CAAC,CAAA;;;;kDAExB;AAlDW,oBAAoB;IADhC,IAAA,mBAAU,EAAC,SAAS,CAAC;qCAE2B,sCAAiB;GADrD,oBAAoB,CAmDhC;AAnDY,oDAAoB"}
{"version":3,"file":"friendship.controller.js","sourceRoot":"","sources":["../../src/friendship/friendship.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAAmI;AAEnI,2DAA4D;AAE5D,uEAAkE;AAClE,uEAAkE;AAElE,6DAAyD;AAGlD,IAAM,oBAAoB,GAA1B,MAAM,oBAAoB;IAChC,YAA6B,iBAAoC;QAApC,sBAAiB,GAAjB,iBAAiB,CAAmB;IAAG,CAAC;IAIrE,SAAS,CAAkB,MAAc;QACxC,OAAO,IAAI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AA,kBAAS,EAAC,wBAAY,CAAC;IACW,WAAA,IAAA,cAAK,EAAC,QAAQ,CAAC,CAAA;;;;6EAEjD;AAED;IAAC,IAAA,YAAG,EAAC,kBAAkB,CAAC;IACvB,IAAA,kBAAS,EAAC,wBAAY,CAAC;IACU,WAAA,IAAA,cAAK,EAAC,QAAQ,CAAC,CAAA;;;;4EAEhD;AAED;IAAC,IAAA,YAAG,EAAC,6BAA6B,CAAC;IAClC,IAAA,kBAAS,EAAC,wBAAY,CAAC;IACT,WAAA,IAAA,cAAK,EAAC,UAAU,CAAC,CAAA;;;;yDAE/B;AAED;IAAC,IAAA,aAAI,GAAE;IACN,IAAA,iBAAQ,EAAC,mBAAU,CAAC,OAAO,CAAC;IAC5B,IAAA,kBAAS,EAAC,wBAAY,CAAC;IAChB,WAAA,IAAA,aAAI,GAAE,CAAA;;qCAAsB,2CAAmB;;kDAEtD;AAED;IAAC,IAAA,cAAK,EAAC,kCAAkC,CAAC;IACzC,IAAA,kBAAS,EAAC,wBAAY,CAAC;IAChB,WAAA,IAAA,cAAK,EAAC,UAAU,CAAC,CAAA;IAA0B,WAAA,IAAA,aAAI,GAAE,CAAA;;6CAAW,2CAAmB;;kDAEtF;AAED;IAAC,IAAA,eAAM,EAAC,mBAAmB,CAAC;IAC3B,IAAA,kBAAS,EAAC,wBAAY,CAAC;IAChB,WAAA,IAAA,cAAK,EAAC,UAAU,CAAC,CAAA;;;;kDAExB;AAlDW,oBAAoB;IADhC,IAAA,mBAAU,EAAC,SAAS,CAAC;qCAE2B,sCAAiB;GADrD,oBAAoB,CAmDhC;AAnDY,oDAAoB"}

View File

@@ -5,9 +5,28 @@ const common_1 = require("@nestjs/common");
const app_module_1 = require("./app.module");
const session = require("express-session");
const passport = require("passport");
const constant_1 = require("./conf/constant");
const redis_1 = require("redis");
const connectRedis = require("connect-redis");
async function bootstrap() {
const app = await core_1.NestFactory.create(app_module_1.AppModule);
const client = (0, redis_1.createClient)({
url: process.env.REDIS_URL,
});
const RedisStore = connectRedis(session);
client
.connect()
.then(async (res) => {
console.log('connected');
})
.catch((err) => {
console.log('err happened' + err);
});
client.on('error', (err) => {
console.log("Redis error: " + err);
});
client.on('connect', () => {
console.log("Redis connected");
});
app.useGlobalPipes(new common_1.ValidationPipe({
whitelist: true,
forbidNonWhitelisted: true,
@@ -22,9 +41,10 @@ async function bootstrap() {
cookie: {
maxAge: 3600000 * 24,
},
secret: constant_1.constants.secret,
secret: process.env.COOKIE_SECRET,
resave: false,
saveUninitialized: false,
store: new RedisStore({ client }),
}));
app.use(passport.initialize());
app.use(passport.session());

View File

@@ -1 +1 @@
{"version":3,"file":"main.js","sourceRoot":"","sources":["../src/main.ts"],"names":[],"mappings":";;AAAA,uCAA2C;AAC3C,2CAAgD;AAChD,6CAAyC;AACzC,2CAA2C;AAC3C,qCAAqC;AACrC,8CAA4C;AAC5C,KAAK,UAAU,SAAS;IAEtB,MAAM,GAAG,GAAG,MAAM,kBAAW,CAAC,MAAM,CAAC,sBAAS,CAAC,CAAC;IAGhD,GAAG,CAAC,cAAc,CACnB,IAAI,uBAAc,CAAC;QAElB,SAAS,EAAE,IAAI;QAEf,oBAAoB,EAAE,IAAI;QAE1B,SAAS,EAAE,IAAI;QACf,gBAAgB,EAAE;YACjB,wBAAwB,EAAE,IAAI;SAC9B;KACD,CAAC,CACA,CAAC;IACF,MAAM,IAAI,GAAG,OAAO,CAAC,GAAG,CAAC,IAAI,IAAI,IAAI,CAAC;IACtC,GAAG,CAAC,eAAe,CAAC,QAAQ,CAAC,CAAC;IAC9B,GAAG,CAAC,GAAG,CACR,OAAO,CAAC;QACN,MAAM,EAAE;YACP,MAAM,EAAE,OAAO,GAAG,EAAE;SACpB;QACD,MAAM,EAAE,oBAAS,CAAC,MAAM;QACxB,MAAM,EAAE,KAAK;QACb,iBAAiB,EAAE,KAAK;KACxB,CAAC,CACF,CAAC;IACF,GAAG,CAAC,GAAG,CAAC,QAAQ,CAAC,UAAU,EAAE,CAAC,CAAC;IAC/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AG,CAAC,cAAc,CACnB,IAAI,uBAAc,CAAC;QAElB,SAAS,EAAE,IAAI;QAEf,oBAAoB,EAAE,IAAI;QAE1B,SAAS,EAAE,IAAI;QACf,gBAAgB,EAAE;YACjB,wBAAwB,EAAE,IAAI;SAC9B;KACD,CAAC,CACA,CAAC;IACF,MAAM,IAAI,GAAG,OAAO,CAAC,GAAG,CAAC,IAAI,IAAI,IAAI,CAAC;IACtC,GAAG,CAAC,eAAe,CAAC,QAAQ,CAAC,CAAC;IAC9B,GAAG,CAAC,GAAG,CACR,OAAO,CAAC;QACN,MAAM,EAAE;YACP,MAAM,EAAE,OAAO,GAAG,EAAE;SACpB;QACD,MAAM,EAAE,OAAO,CAAC,GAAG,CAAC,aAAa;QACjC,MAAM,EAAE,KAAK;QACb,iBAAiB,EAAE,KAAK;QACxB,KAAK,EAAE,IAAI,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;KAEjC,CAAC,CACF,CAAC;IACF,GAAG,CAAC,GAAG,CAAC,QAAQ,CAAC,UAAU,EAAE,CAAC,CAAC;IAC/B,GAAG,CAAC,GAAG,CAAC,QAAQ,CAAC,OAAO,EAAE,CAAC,CAAC;IAC5B,MAAM,GAAG,CAAC,MAAM,CAAC,IAAI,EAAE,GAAG,EAAE,GAAG,OAAO,CAAC,GAAG,CAAC,qBAAqB,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAC7E,CAAC;AACD,SAAS,EAAE,CAAC"}

View File

@@ -0,0 +1,2 @@
export declare class RedisModule {
}

View File

@@ -0,0 +1,26 @@
"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.RedisModule = void 0;
const common_1 = require("@nestjs/common");
const Redis = require("redis");
let RedisModule = class RedisModule {
};
RedisModule = __decorate([
(0, common_1.Module)({
providers: [
{
provide: 'REDIS',
useValue: Redis.createClient({ port: 6379, host: process.env.REDIS_HOST }),
},
],
exports: ['REDIS'],
})
], RedisModule);
exports.RedisModule = RedisModule;
//# sourceMappingURL=redis.module.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"redis.module.js","sourceRoot":"","sources":["../../src/redis/redis.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAwC;AACxC,+BAA+B;AAWxB,IAAM,WAAW,GAAjB,MAAM,WAAW;CAAG,CAAA;AAAd,WAAW;IATvB,IAAA,eAAM,EAAC;QACP,SAAS,EAAE;YACV;gBACC,OAAO,EAAE,OAAO;gBAChB,QAAQ,EAAE,KAAK,CAAC,YAAY,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,CAAC,GAAG,CAAC,UAAU,EAAE,CAAC;aAC1E;SACD;QACD,OAAO,EAAE,CAAC,OAAO,CAAC;KAClB,CAAC;GACW,WAAW,CAAG;AAAd,kCAAW"}

File diff suppressed because one or more lines are too long

View File

@@ -6,8 +6,8 @@ export declare class UsersController {
private readonly usersService;
constructor(usersService: UsersService);
findAll(paginationquery: PaginationQueryDto): Promise<import("./entities/user.entity").User[]>;
findOne(id: string): Promise<import("./entities/user.entity").User>;
findOne(req: any): Promise<import("./entities/user.entity").User>;
create(createUsersDto: CreateUsersDto): Promise<import("./entities/user.entity").User>;
update(id: string, usersUpdateDto: UpdateUsersDto): Promise<import("./entities/user.entity").User>;
remove(id: string): Promise<import("./entities/user.entity").User>;
update(req: any, usersUpdateDto: UpdateUsersDto): Promise<import("./entities/user.entity").User>;
remove(req: any): Promise<import("./entities/user.entity").User>;
}

View File

@@ -14,7 +14,7 @@ var __param = (this && this.__param) || function (paramIndex, decorator) {
Object.defineProperty(exports, "__esModule", { value: true });
exports.UsersController = void 0;
const common_1 = require("@nestjs/common");
const guards_1 = require("../auth/42/guards/guards");
const _42guards_1 = require("../auth/42/guards/42guards");
const pagination_query_dto_1 = require("../common/dto/pagination-query.dto");
const create_users_dto_1 = require("./dto/create-users.dto");
const update_users_dto_1 = require("./dto/update-users.dto");
@@ -26,39 +26,40 @@ let UsersController = class UsersController {
findAll(paginationquery) {
return this.usersService.findAll(paginationquery);
}
findOne(id) {
return this.usersService.findOne(id);
findOne(req) {
console.log('INSIDE USER CONTROLLER');
console.log(req.user);
return this.usersService.findOne(req.user.id);
}
create(createUsersDto) {
console.log(createUsersDto);
return this.usersService.create(createUsersDto);
}
update(id, usersUpdateDto) {
return this.usersService.update(id, usersUpdateDto);
update(req, usersUpdateDto) {
return this.usersService.update(req.user.id, usersUpdateDto);
}
remove(id) {
return this.usersService.remove(id);
remove(req) {
return this.usersService.remove(req.user.id);
}
};
__decorate([
(0, common_1.UseGuards)(_42guards_1.AuthenticateGuard),
(0, common_1.Get)('all'),
(0, common_1.UseGuards)(guards_1.FortyTwoAuthGuard),
__param(0, (0, common_1.Query)()),
__metadata("design:type", Function),
__metadata("design:paramtypes", [pagination_query_dto_1.PaginationQueryDto]),
__metadata("design:returntype", void 0)
], UsersController.prototype, "findAll", null);
__decorate([
(0, common_1.Get)(':id'),
(0, common_1.UseGuards)(guards_1.FortyTwoAuthGuard),
__param(0, (0, common_1.Param)('id')),
(0, common_1.UseGuards)(_42guards_1.AuthenticateGuard),
(0, common_1.Get)(),
__param(0, (0, common_1.Req)()),
__metadata("design:type", Function),
__metadata("design:paramtypes", [String]),
__metadata("design:paramtypes", [Object]),
__metadata("design:returntype", void 0)
], UsersController.prototype, "findOne", null);
__decorate([
(0, common_1.UseGuards)(_42guards_1.AuthenticateGuard),
(0, common_1.Post)(),
(0, common_1.UseGuards)(guards_1.FortyTwoAuthGuard),
(0, common_1.HttpCode)(common_1.HttpStatus.CREATED),
__param(0, (0, common_1.Body)()),
__metadata("design:type", Function),
@@ -66,20 +67,20 @@ __decorate([
__metadata("design:returntype", void 0)
], UsersController.prototype, "create", null);
__decorate([
(0, common_1.Patch)(':id'),
(0, common_1.UseGuards)(guards_1.FortyTwoAuthGuard),
__param(0, (0, common_1.Param)('id')),
(0, common_1.Patch)(),
(0, common_1.UseGuards)(_42guards_1.AuthenticateGuard),
__param(0, (0, common_1.Req)()),
__param(1, (0, common_1.Body)()),
__metadata("design:type", Function),
__metadata("design:paramtypes", [String, update_users_dto_1.UpdateUsersDto]),
__metadata("design:paramtypes", [Object, update_users_dto_1.UpdateUsersDto]),
__metadata("design:returntype", void 0)
], UsersController.prototype, "update", null);
__decorate([
(0, common_1.Delete)(':id'),
(0, common_1.UseGuards)(guards_1.FortyTwoAuthGuard),
__param(0, (0, common_1.Param)('id')),
(0, common_1.UseGuards)(_42guards_1.AuthenticateGuard),
__param(0, (0, common_1.Req)()),
__metadata("design:type", Function),
__metadata("design:paramtypes", [String]),
__metadata("design:paramtypes", [Object]),
__metadata("design:returntype", void 0)
], UsersController.prototype, "remove", null);
UsersController = __decorate([

View File

@@ -1 +1 @@
{"version":3,"file":"users.controller.js","sourceRoot":"","sources":["../../src/users/users.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAGwB;AACxB,qDAA8D;AAC9D,6EAAyE;AACzE,6DAAwD;AACxD,6DAAwD;AAExD,mDAA+C;AAIxC,IAAM,eAAe,GAArB,MAAM,eAAe;IAC3B,YAA6B,YAA0B;QAA1B,iBAAY,GAAZ,YAAY,CAAc;IAAG,CAAC;IAK3D,OAAO,CAAU,eAAoC;QAEpD,OAAO,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,eAAe,CAAC,CAAC;IACnD,CAAC;IAID,OAAO,CAAc,EAAU;QAC9B,OAAO,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;IACtC,CAAC;IAKD,M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A,kBAAS,EAAC,6BAAiB,CAAC;IAC5B,IAAA,YAAG,GAAE;IACG,WAAA,IAAA,YAAG,GAAE,CAAA;;;;8CAIb;AAED;IAAC,IAAA,kBAAS,EAAC,6BAAiB,CAAC;IAC5B,IAAA,aAAI,GAAE;IACN,IAAA,iBAAQ,EAAC,mBAAU,CAAC,OAAO,CAAC;IACrB,WAAA,IAAA,aAAI,GAAE,CAAA;;qCAAkB,iCAAc;;6CAE7C;AAED;IAAC,IAAA,cAAK,GAAE;IACP,IAAA,kBAAS,EAAC,6BAAiB,CAAC;IACrB,WAAA,IAAA,YAAG,GAAE,CAAA;IAAO,WAAA,IAAA,aAAI,GAAE,CAAA;;6CAAiB,iCAAc;;6CAExD;AAED;IAAC,IAAA,eAAM,EAAC,KAAK,CAAC;IACb,IAAA,kBAAS,EAAC,6BAAiB,CAAC;IACrB,WAAA,IAAA,YAAG,GAAE,CAAA;;;;6CAEZ;AApCW,eAAe;IAD3B,IAAA,mBAAU,EAAC,MAAM,CAAC;qCAEyB,4BAAY;GAD3C,eAAe,CAqC3B;AArCY,0CAAe"}

View File

@@ -1 +1 @@
{"version":3,"file":"users.module.js","sourceRoot":"","sources":["../../src/users/users.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAwC;AACxC,mDAA+C;AAC/C,yDAAqD;AACrD,wDAA8C;AAC9C,6CAAgD;AAChD,gFAAsE;AAQ/D,IAAM,WAAW,GAAjB,MAAM,WAAW;CAAG,CAAA;AAAd,WAAW;IANvB,IAAA,eAAM,EAAC;QACP,OAAO,EAAE,CAAC,uBAAa,CAAC,UAAU,CAAC,CAAC,kBAAI,EAAE,8BAAU,EAAE,CAAC,CAAC;QACxD,SAAS,EAAE,CAAC,4BAAY,CAAC;QACzB,OAAO,EAAE,CAAC,4BAAY,CAAC;QACvB,WAAW,EAAE,CAAC,kCAAe,CAAC;KAC9B,CAAC;GACW,WAAW,CAAG;AAAd,kCAAW"}
{"version":3,"file":"users.module.js","sourceRoot":"","sources":["../../src/users/users.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAwC;AACxC,mDAA+C;AAC/C,yDAAqD;AACrD,wDAA8C;AAC9C,6CAAgD;AAChD,gFAAsE;AAU/D,IAAM,WAAW,GAAjB,MAAM,WAAW;CAAG,CAAA;AAAd,WAAW;IANvB,IAAA,eAAM,EAAC;QACP,OAAO,EAAE,CAAC,uBAAa,CAAC,UAAU,CAAC,CAAC,kBAAI,EAAE,8BAAU,EAAE,CAAC,CAAC;QACxD,SAAS,EAAE,CAAC,4BAAY,CAAC;QACzB,OAAO,EAAE,CAAC,4BAAY,CAAC;QACvB,WAAW,EAAE,CAAC,kCAAe,CAAC;KAC9B,CAAC;GACW,WAAW,CAAG;AAAd,kCAAW"}

View File

@@ -37,8 +37,6 @@ let UsersService = class UsersService {
return user;
}
async findOne(id) {
if (!(0, class_validator_1.isNumberString)(id))
throw new common_1.HttpException(`The requested user not found.`, common_1.HttpStatus.NOT_FOUND);
const user = await this.userRepository.findOneBy({ id: +id });
if (!user)
throw new common_1.NotFoundException(`The requested user not found.`);

View File

@@ -1 +1 @@
{"version":3,"file":"users.service.js","sourceRoot":"","sources":["../../src/users/users.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAAsG;AACtG,6CAAmD;AAEnD,wDAA8C;AAC9C,qCAA8D;AAG9D,gFAAsE;AACtE,qDAAiD;AAM1C,IAAM,YAAY,GAAlB,MAAM,YAAY;IAExB,YAEiB,cAAgC,EAEhC,oBAA4C;QAF5C,mBAAc,GAAd,cAAc,CAAkB;QAEhC,yBAAoB,GAApB,oBAAoB,CAAwB;IAC1D,CAAC;IAEJ,KAAK,CAAC,oBAAoB,CAAC,YAAoB;QAC9C,OAAO,CAAC,GAAG,CAAC,+BAA+B,YAAY,EAAE,CAAC,CAAC;QAC3D,IAAI,CAAC,IAAA,gCAAc,EAAC,YAAY,CAAC;YAChC,MAAM,IAAI,sBAAa,CAAC,+BAA+B,EAAC,mBAAU,CAAC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