mirror of
https://github.com/Infisical/infisical.git
synced 2026-01-10 07:58:15 -05:00
patch dup email bug for login
This commit is contained in:
@@ -74,7 +74,7 @@ export const login1 = async (req: Request, res: Response) => {
|
||||
// generate server-side public key
|
||||
const serverPublicKey = server.getPublicKey();
|
||||
await LoginSRPDetail.findOneAndReplace({
|
||||
userId: user.id,
|
||||
email: email
|
||||
}, {
|
||||
email,
|
||||
userId: user.id,
|
||||
@@ -125,7 +125,7 @@ export const login2 = async (req: Request, res: Response) => {
|
||||
})
|
||||
}
|
||||
|
||||
const loginSRPDetail = await LoginSRPDetail.findOneAndDelete({ userId: user.id });
|
||||
const loginSRPDetail = await LoginSRPDetail.findOneAndDelete({ email: email })
|
||||
|
||||
if (!loginSRPDetail) {
|
||||
return BadRequestError(Error("Failed to find login details for SRP"))
|
||||
|
||||
@@ -20,10 +20,6 @@ const loginSRPDetailSchema = new Schema<ILoginSRPDetail>(
|
||||
unique: true
|
||||
},
|
||||
serverBInt: { type: mongoose.Schema.Types.Buffer },
|
||||
userId: {
|
||||
type: String,
|
||||
unique: true,
|
||||
},
|
||||
expireAt: { type: Date }
|
||||
}
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user