Skip to content

Commit fa69d09

Browse files
author
Uttam Singh
committed
Added OTP model for password reset system
1 parent 61c4edd commit fa69d09

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

backend/app/models/otp.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
from sqlalchemy import Column, Integer, String, DateTime
2+
from datetime import datetime, timedelta
3+
from app.database import Base
4+
5+
class OtpModel(Base):
6+
__tablename__ = "otp_records"
7+
8+
id = Column(Integer, primary_key=True, index=True)
9+
email = Column(String, index=True, nullable=False)
10+
otp = Column(String, nullable=False)
11+
expires_at = Column(DateTime, default=lambda: datetime.utcnow() + timedelta(minutes=10))

0 commit comments

Comments
 (0)