keyshade-xyz / keyshade

Realtime secret and configuration management tool, with the best in class security and seamless integration support
https://keyshade.xyz
Mozilla Public License 2.0
207 stars 103 forks source link

Resend OTP feature #325

Closed rajdip-b closed 6 days ago

rajdip-b commented 4 months ago

Description

image

We need to come up with an implementation to resend the OTP to the users. The resend functionality should have a timeout of 1 minute.

Solution

General Note: This is a join issue, so this ticket will be considered as completed only if both the issues are marked as complete. Note for FOSS Hack: We saw a few requests for team collaboration. We feel that this would be the best place to do so!

harshdeshmukh21 commented 3 months ago

I would like to contribute to this project. I feel I can do this task according to the need. I have registered my team via Foss Hack.

rajdip-b commented 3 months ago

Hey @harshdeshmukh21! Thanks for showing interest in this issue, but unfortunately this is already assigned. If you still want to contribute to this, I would recommend you to have a chat with the assigned members in the sub issues.

Alternatively, your team can pick up any of the other issues.

Prakhargarg-2010196 commented 1 month ago

@rajdip-b I am taking this entire thing hope so it wouldn't be an issue will be back in few days with some solution?

rajdip-b commented 1 month ago

Yeap thats fine!

Prakhargarg-2010196 commented 1 month ago

@rajdip-b Why do we use params for sending data to api/send-otp/:email and not POST body?

rajdip-b commented 1 month ago

There's no reason to be very honest. We could have used request body, but we didn't.

Prakhargarg-2010196 commented 1 month ago

There's no reason to be very honest. We could have used request body, but we didn't.

  • Is it anti-pattern? Yes.
  • Is it causing a lot of trouble? No.
  • Is it exposing sensitive data? No (i believe)

Okay @rajdip-b I am following the same in resend otp, one thing more when do i have to run migrations in prisma like I am trying to utilise the existing logic of the sendOtp service by calling it in the resendOtp function but its showing some prisma issues..

rajdip-b commented 1 month ago

Until and unless you modify schema.prisma, you don't need to run migrations. But when you do, you need to run pnpm db:generate-migrations.

Whether you run migrations or not, you would need to run pnpm db:generate-types so that typescript can infer the types.

And lastly, you would be deploying the migrations using pnpm db:deploy-migrations in the following cases:

Prakhargarg-2010196 commented 1 week ago

This can be closed i guess now @rajdip-b

rajdip-b commented 1 week ago

Could you please link the pr here? I think we missed it

Prakhargarg-2010196 commented 6 days ago

Could you please link the pr here? I think we missed it

The related issues of this PR are solved @rajdip-b can check.

rajdip-b commented 6 days ago

Yes, I'm asking for that PR link. Because i think it was not linked to the issue. I'll link it and close the issue

Prakhargarg-2010196 commented 6 days ago

Yes, I'm asking for that PR link. Because i think it was not linked to the issue. I'll link it and close the issue

I don't think so the combined PR exists but the Related PR are

445 and #489

rajdip-b commented 6 days ago

Fixed by