Skip to content

Commit

Permalink
Refactor: pass new refactors of development
Browse files Browse the repository at this point in the history
  • Loading branch information
KristhDev committed Mar 23, 2024
1 parent aaefcd8 commit 840de63
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ test de la aplicación.
<a href="https://creativecommons.org/licenses/by/4.0">
<img alt="License: Attribution 4.0 International" src="https://img.shields.io/badge/License-Attribution%204.0%20International-blue.svg" />
</a>
<a href="https://github.com/KristhDev/ReactTasks-backend/releases/tag/v1.0.1">
<img alt="Api Version" src="https://img.shields.io/badge/Version-%201.0.1%20-brightgreen.svg" />
<a href="https://github.com/KristhDev/ReactTasks-backend/releases/tag/v1.1.0">
<img alt="Api Version" src="https://img.shields.io/badge/Version-%201.1.0%20-brightgreen.svg" />
</a>
</p>

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "reacttasks-backend",
"version": "1.0.1",
"version": "1.1.0",
"description": "",
"main": "index.js",
"scripts": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { VerificationRepository } from '@database';
/* Auth */
import { AuthErrorMessages, EmailService, JWT } from '@auth';

class ResetPasswordController {
class ForgotPasswordController {
/**
* Handles the request and generates a response.
*
Expand Down Expand Up @@ -45,4 +45,4 @@ class ResetPasswordController {
}
}

export default ResetPasswordController;
export default ForgotPasswordController;
2 changes: 1 addition & 1 deletion src/modules/auth/controllers/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ export { default as ChangePasswordController } from './change-password';
export { default as RefreshAuthController } from './refresh-auth';
export { default as RemoveTokensController } from './remove-tokens';
export { default as RemoveVerificationsController } from './remove-verifications';
export { default as ResetPasswordController } from './reset-password';
export { default as ForgotPasswordController } from './forgot-password';
export { default as SendEmailVerificationController } from './send-email-verification';
export { default as SignInController } from './sign-in';
export { default as SignOutController } from './sign-out';
Expand Down
6 changes: 3 additions & 3 deletions src/modules/auth/router/router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ import { checkAuth, checkAuthSecret, checkVerificationToken, userExists } from '
/* Controllers */
import {
ChangePasswordController,
ForgotPasswordController,
RefreshAuthController,
RemoveTokensController,
RemoveVerificationsController,
ResetPasswordController,
SendEmailVerificationController,
SignInController,
SignOutController,
Expand Down Expand Up @@ -74,10 +74,10 @@ router.put(
);

router.post(
usersRoutes.RESET_PASSWORD,
usersRoutes.FORGOT_PASSWORD,
(req, res, next) => validateRequest(req, res, next, EmailSchema),
userExists,
ResetPasswordController.handler
ForgotPasswordController.handler
);

router.put(
Expand Down
2 changes: 1 addition & 1 deletion src/modules/auth/router/routes.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
export const usersRoutes = {
CHANGE_PASSWORD: '/change-password',
FORGOT_PASSWORD: '/forgot-password',
REFRESH: '/refresh',
REMOVE_TOKENS: '/remove-tokens',
REMOVE_VERIFICATIONS: '/remove-verifications',
RESET_PASSWORD: '/reset-password',
SIGN_IN: '/signin',
SIGN_OUT: '/signout',
SIGN_UP: '/signup',
Expand Down
4 changes: 2 additions & 2 deletions src/modules/auth/services/email.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class EmailService {
name,
text: 'Te enviamos este correo para verificar tu cuenta.',
title: 'Verificación de correo',
url: `${ process.env.CLIENT_URL }/verify-email?token=${ token }`
url: `${ process.env.CLIENT_URL }/auth/verify-email?token=${ token }`
}

const html = ejs.render(templateString, data);
Expand Down Expand Up @@ -97,7 +97,7 @@ class EmailService {
name,
text: 'Te enviamos este correo para reestablecer tu contraseña.',
title: 'Reestablecer contraseña',
url: `${ process.env.CLIENT_URL }/reset-password?token=${ token }`
url: `${ process.env.CLIENT_URL }/auth/change-password?token=${ token }`
}

const html = ejs.render(templateString, data);
Expand Down

0 comments on commit 840de63

Please sign in to comment.