1234567891011121314151617181920212223 |
- import { logger } from "#logger";
- import bcript from "bcrypt";
- import { DayjsUtils } from "#dayjsUtils";
- // db
- import { db } from "#db";
- import { sql } from "slonik";
- class userAuthService {
- async authTriesIncrement(userId: string) {
- await db.any(
- sql.unsafe`update users.user_profiles set wrong_pass_tries = wrong_pass_tries + 1 where user_id = ${userId}`,
- );
- }
- async resetAuthTries(userId: string) {
- await db.any(
- sql.unsafe`update users.user_profiles set wrong_pass_tries = 0 where user_id = ${userId}`,
- );
- }
- }
- export const UserAuthService = new userAuthService();
|