-แก้ไขข้อผิดำลาก redis
This commit is contained in:
@@ -1,14 +1,14 @@
|
||||
import Redis from 'ioredis';
|
||||
import bcrypt from 'bcrypt';
|
||||
import crypto from 'crypto';
|
||||
import nodemailer from 'nodemailer';
|
||||
import { GeneralService } from '../share/generalservice.js';
|
||||
import { sendError } from '../utils/response.js';
|
||||
import redis from '../utils/redis.js';
|
||||
|
||||
export class RegisterService {
|
||||
|
||||
constructor() {
|
||||
this.redis = new Redis();
|
||||
// this.redis = new Redis();
|
||||
this.generalService = new GeneralService();
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@ export class RegisterService {
|
||||
|
||||
|
||||
const payload = JSON.stringify({ fname, lname, hashedPwd, token, database });
|
||||
await this.redis.set(`verify:${email}`, payload, 'EX', 86400); // 24h
|
||||
await redis.set(`verify:${email}`, payload, 'EX', 86400); // 24h
|
||||
|
||||
|
||||
const verifyUrl = `http://localhost:1012/login/verify-email?token=${token}&email=${encodeURIComponent(email)}&organization=${database}`;
|
||||
|
||||
Reference in New Issue
Block a user