bsiness
This commit is contained in:
@@ -4,10 +4,11 @@ import { CacheService } from '../../utils/cache.service';
|
||||
import { SmsService } from '../../notifications/services/sms.service';
|
||||
import { randomInt } from 'crypto';
|
||||
import { TokensService } from './tokens.service';
|
||||
import { AuthMessage, RestMessage } from 'src/common/enums/message.enum';
|
||||
import { AuthMessage, RestMessage } from 'src/common/enums/message.enum';
|
||||
import { AdminRepository } from 'src/modules/admin/repositories/admin.repository';
|
||||
import { ConfigService } from '@nestjs/config';
|
||||
import { normalizePhone } from '../../utils/phone.util';
|
||||
import { BusinessService } from 'src/modules/business/business.service';
|
||||
|
||||
@Injectable()
|
||||
export class AuthService {
|
||||
@@ -17,18 +18,23 @@ export class AuthService {
|
||||
private readonly cacheService: CacheService,
|
||||
private readonly smsService: SmsService,
|
||||
private readonly tokensService: TokensService,
|
||||
private readonly adminRepository: AdminRepository,
|
||||
private readonly adminRepository: AdminRepository,
|
||||
private readonly configService: ConfigService,
|
||||
private readonly businessService: BusinessService,
|
||||
) {
|
||||
this.OTP_EXPIRATION_TIME = this.configService.get<number>('OTP_EXPIRATION_TIME') ?? 240;
|
||||
}
|
||||
|
||||
private userOtpKey(restaurantSlug: string, phone: string) {
|
||||
return `otp:${restaurantSlug}:${phone}`;
|
||||
}
|
||||
// private userOtpKey(restaurantSlug: string, phone: string) {
|
||||
// return `otp:${restaurantSlug}:${phone}`;
|
||||
// }
|
||||
|
||||
private adminOtpKey(restaurantSlug: string, phone: string) {
|
||||
return `otp-admin:${restaurantSlug}:${phone}`;
|
||||
// private adminOtpKey(restaurantSlug: string, phone: string) {
|
||||
// return `otp-admin:${restaurantSlug}:${phone}`;
|
||||
// }
|
||||
|
||||
directLogin(danakSubId: string) {
|
||||
const business=this.businessService.findBySubIdOrFail(danakSubId)
|
||||
}
|
||||
|
||||
// async requestOtp(dto: RequestOtpDto, isAdmin: boolean) {
|
||||
|
||||
Reference in New Issue
Block a user