Configure remote database connection and update documentation
This commit is contained in:
68
backend/dist/modules/auth/auth.resolver.js
vendored
Normal file
68
backend/dist/modules/auth/auth.resolver.js
vendored
Normal file
@ -0,0 +1,68 @@
|
||||
"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.AuthResolver = void 0;
|
||||
const graphql_1 = require("@nestjs/graphql");
|
||||
const auth_service_1 = require("./auth.service");
|
||||
const user_entity_1 = require("../users/entities/user.entity");
|
||||
let AuthResponse = class AuthResponse {
|
||||
access_token;
|
||||
user;
|
||||
};
|
||||
__decorate([
|
||||
(0, graphql_1.Field)(),
|
||||
__metadata("design:type", String)
|
||||
], AuthResponse.prototype, "access_token", void 0);
|
||||
__decorate([
|
||||
(0, graphql_1.Field)(() => user_entity_1.User),
|
||||
__metadata("design:type", user_entity_1.User)
|
||||
], AuthResponse.prototype, "user", void 0);
|
||||
AuthResponse = __decorate([
|
||||
(0, graphql_1.ObjectType)()
|
||||
], AuthResponse);
|
||||
let AuthResolver = class AuthResolver {
|
||||
authService;
|
||||
constructor(authService) {
|
||||
this.authService = authService;
|
||||
}
|
||||
async login(username, password) {
|
||||
return this.authService.login(username, password);
|
||||
}
|
||||
async register(username, email, password) {
|
||||
return this.authService.register(username, email, password);
|
||||
}
|
||||
};
|
||||
exports.AuthResolver = AuthResolver;
|
||||
__decorate([
|
||||
(0, graphql_1.Mutation)(() => AuthResponse),
|
||||
__param(0, (0, graphql_1.Args)('username')),
|
||||
__param(1, (0, graphql_1.Args)('password')),
|
||||
__metadata("design:type", Function),
|
||||
__metadata("design:paramtypes", [String, String]),
|
||||
__metadata("design:returntype", Promise)
|
||||
], AuthResolver.prototype, "login", null);
|
||||
__decorate([
|
||||
(0, graphql_1.Mutation)(() => AuthResponse),
|
||||
__param(0, (0, graphql_1.Args)('username')),
|
||||
__param(1, (0, graphql_1.Args)('email')),
|
||||
__param(2, (0, graphql_1.Args)('password')),
|
||||
__metadata("design:type", Function),
|
||||
__metadata("design:paramtypes", [String, String, String]),
|
||||
__metadata("design:returntype", Promise)
|
||||
], AuthResolver.prototype, "register", null);
|
||||
exports.AuthResolver = AuthResolver = __decorate([
|
||||
(0, graphql_1.Resolver)(),
|
||||
__metadata("design:paramtypes", [auth_service_1.AuthService])
|
||||
], AuthResolver);
|
||||
//# sourceMappingURL=auth.resolver.js.map
|
Reference in New Issue
Block a user