a LOTTTA more migration hoopla shii
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import { errAsync, okAsync, ResultAsync } from "neverthrow";
|
||||
import { FlowExecCtx } from "@core/flow.execution.context";
|
||||
import { UserRepository } from "@domains/user/repository";
|
||||
import { getRedisInstance, Redis } from "@pkg/redis";
|
||||
import { getRedisInstance, Redis } from "@pkg/keystore";
|
||||
import { TwofaRepository } from "./repository";
|
||||
import { auth } from "../auth/config.base";
|
||||
import type { TwoFaSession } from "./data";
|
||||
@@ -17,6 +17,7 @@ export class TwofaController {
|
||||
private twofaRepo: TwofaRepository,
|
||||
private userRepo: UserRepository,
|
||||
private store: Redis,
|
||||
private secret: string,
|
||||
) {}
|
||||
|
||||
checkTotp(secret: string, code: string) {
|
||||
@@ -42,7 +43,7 @@ export class TwofaController {
|
||||
.andThen((enabled) =>
|
||||
enabled
|
||||
? errAsync(twofaErrors.alreadyEnabled(fctx))
|
||||
: this.twofaRepo.setup(fctx, user.id),
|
||||
: this.twofaRepo.setup(fctx, user.id, this.secret),
|
||||
)
|
||||
.map((secret) => {
|
||||
const appName = settings.appName;
|
||||
@@ -345,5 +346,6 @@ export function getTwofaController() {
|
||||
new TwofaRepository(db, _redis),
|
||||
new UserRepository(db),
|
||||
_redis,
|
||||
settings.twoFaSecret,
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user