feat: add password reset functionality and email notifications
- Implemented forgot password and reset password routes in the backend. - Added email sending capabilities using Nodemailer for password reset requests. - Created ResetPassword page in the frontend for users to reset their passwords. - Updated user model to include reset token and expiry fields. - Integrated hiscores API with caching mechanism for improved performance. - Enhanced authentication modal to include forgot password option. - Updated environment configuration for SMTP settings.
This commit is contained in:
@@ -15,16 +15,18 @@ enum Role {
|
||||
|
||||
// User authentication
|
||||
model User {
|
||||
id Int @id @default(autoincrement())
|
||||
username String @unique
|
||||
email String @unique
|
||||
passwordHash String
|
||||
role Role @default(USER)
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
sessions Session[]
|
||||
characters Character[]
|
||||
ownedGroups Group[] @relation("GroupOwner")
|
||||
id Int @id @default(autoincrement())
|
||||
username String @unique
|
||||
email String @unique
|
||||
passwordHash String
|
||||
role Role @default(USER)
|
||||
resetToken String? // Password reset token
|
||||
resetTokenExpiry DateTime? // Token expiration time
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
sessions Session[]
|
||||
characters Character[]
|
||||
ownedGroups Group[] @relation("GroupOwner")
|
||||
}
|
||||
|
||||
// User's OSRS characters (for task/unlock tracking)
|
||||
@@ -213,3 +215,16 @@ model CollectionLogNew {
|
||||
|
||||
@@id([memberId, pageId])
|
||||
}
|
||||
|
||||
// Hiscores cache - stores fetched hiscores data
|
||||
model HiscoresCache {
|
||||
rsn String @id // RuneScape Name (lowercase for lookup)
|
||||
displayRsn String // Original case RSN for display
|
||||
skills String // JSON - skill data
|
||||
clues String // JSON - clue scroll data
|
||||
activities String // JSON - activities/bosses data
|
||||
leaguePoints Int @default(0)
|
||||
fetchedAt DateTime @default(now())
|
||||
|
||||
@@index([fetchedAt])
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user