refactor: Optimize Docker build process, switch to @node-rs/bcrypt, and streamline compose.yaml by removing external services.
This commit is contained in:
parent
18660fa364
commit
c1254520b4
6 changed files with 218 additions and 405 deletions
|
|
@ -2,7 +2,7 @@ import { prisma } from '../config/database';
|
|||
import { Prisma } from '@prisma/client';
|
||||
import { config } from '../config';
|
||||
import { logger } from '../config/logger';
|
||||
import bcrypt from 'bcrypt';
|
||||
import bcrypt from '@node-rs/bcrypt';
|
||||
import jwt from 'jsonwebtoken';
|
||||
import {
|
||||
LoginRequest,
|
||||
|
|
@ -295,7 +295,7 @@ export class AuthService {
|
|||
async resetRequest(email: string): Promise<ResetRequestResponse> {
|
||||
try {
|
||||
// Find user with role
|
||||
const user = await prisma.user.findUnique({
|
||||
const user = await prisma.user.findUnique({
|
||||
where: { email },
|
||||
include: { role: true }
|
||||
});
|
||||
|
|
@ -305,7 +305,7 @@ export class AuthService {
|
|||
|
||||
// Create reset URL based on role
|
||||
const isInstructor = user.role.code === 'INSTRUCTOR';
|
||||
const baseUrl = isInstructor
|
||||
const baseUrl = isInstructor
|
||||
? (process.env.FRONTEND_URL_INSTRUCTOR || 'http://localhost:3001')
|
||||
: (process.env.FRONTEND_URL_STUDENT || 'http://localhost:3000');
|
||||
const resetURL = `${baseUrl}/reset-password?token=${token}`;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue