From e0fbbeca3c1a858838b20aeead52694772b7d871 Mon Sep 17 00:00:00 2001 From: Elias Schneider Date: Fri, 3 Nov 2023 08:38:23 +0100 Subject: [PATCH] feat: change totp issuer to display logo in 2FAS app --- backend/src/auth/authTotp.service.ts | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/backend/src/auth/authTotp.service.ts b/backend/src/auth/authTotp.service.ts index 1b4f0d4..ebbffe8 100644 --- a/backend/src/auth/authTotp.service.ts +++ b/backend/src/auth/authTotp.service.ts @@ -8,7 +8,6 @@ import { User } from "@prisma/client"; import * as argon from "argon2"; import { authenticator, totp } from "otplib"; import * as qrcode from "qrcode-svg"; -import { ConfigService } from "src/config/config.service"; import { PrismaService } from "src/prisma/prisma.service"; import { AuthService } from "./auth.service"; import { AuthSignInTotpDTO } from "./dto/authSignInTotp.dto"; @@ -18,7 +17,6 @@ export class AuthTotpService { constructor( private prisma: PrismaService, private authService: AuthService, - private config: ConfigService, ) {} async signInTotp(dto: AuthSignInTotpDTO) { @@ -78,12 +76,11 @@ export class AuthTotpService { throw new BadRequestException("TOTP is already enabled"); } - // TODO: Maybe make the issuer configurable with env vars? const secret = authenticator.generateSecret(); const otpURL = totp.keyuri( user.username || user.email, - this.config.get("general.appName"), + "pingvin-share", secret, );