mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-07 19:28:09 +00:00
fixed login issue after mfa
This commit is contained in:
@@ -288,6 +288,8 @@ export const verifyMfaToken = async (req: Request, res: Response) => {
|
|||||||
|
|
||||||
if (!user) throw new Error('Failed to find user');
|
if (!user) throw new Error('Failed to find user');
|
||||||
|
|
||||||
|
await LoginSRPDetail.deleteOne({ userId: user.id })
|
||||||
|
|
||||||
await checkUserDevice({
|
await checkUserDevice({
|
||||||
user,
|
user,
|
||||||
ip: req.ip,
|
ip: req.ip,
|
||||||
|
|||||||
@@ -76,6 +76,7 @@ export const login1 = async (req: Request, res: Response) => {
|
|||||||
await LoginSRPDetail.findOneAndReplace({
|
await LoginSRPDetail.findOneAndReplace({
|
||||||
userId: user.id,
|
userId: user.id,
|
||||||
}, {
|
}, {
|
||||||
|
email,
|
||||||
userId: user.id,
|
userId: user.id,
|
||||||
clientPublicKey: clientPublicKey,
|
clientPublicKey: clientPublicKey,
|
||||||
serverBInt: bigintConversion.bigintToBuf(server.bInt),
|
serverBInt: bigintConversion.bigintToBuf(server.bInt),
|
||||||
@@ -115,7 +116,7 @@ export const login2 = async (req: Request, res: Response) => {
|
|||||||
}).select('+salt +verifier +encryptionVersion +protectedKey +protectedKeyIV +protectedKeyTag +publicKey +encryptedPrivateKey +iv +tag');
|
}).select('+salt +verifier +encryptionVersion +protectedKey +protectedKeyIV +protectedKeyTag +publicKey +encryptedPrivateKey +iv +tag');
|
||||||
|
|
||||||
if (!user) throw new Error('Failed to find user');
|
if (!user) throw new Error('Failed to find user');
|
||||||
|
|
||||||
if (user.authProvider) {
|
if (user.authProvider) {
|
||||||
await validateProviderAuthToken({
|
await validateProviderAuthToken({
|
||||||
email,
|
email,
|
||||||
|
|||||||
Reference in New Issue
Block a user