Releases: EnkhsaikhanCh/nextjs-learn-acme
v0.12.0
Release v0.12.0 – Authentication and OTP Flow Improvements
This release introduces important updates across the authentication system, with a strong focus on enhancing OTP verification, login, and registration flows. Improvements span from backend resolver logic to frontend hooks and user interface behavior.
Key Updates
Test Enhancements
- Added
findOne
mock forUserV2Model
inverify-otp-mutation.spec.ts
. - Introduced a new test case for scenarios where a user is not found after successful OTP verification, ensuring the resolver handles this edge case properly.
- Updated success response tests to assert the full
user
object is returned from the OTP verification mutation.
Resolver Improvements
- Modified the
verifyOTP
resolver to explicitly fetch the user usingUserV2Model.findOne
and include the user object in the response. - Added error handling for missing user after OTP success.
- Removed the unused
generateTempTokenService
import fromregister-user-with-otp-mutation.ts
.
New Hooks for Authentication
useHandleLoginV2
: Simplifies login by handling validation, OTP sending, and role-based redirection.useOTPVerificationV2
: Manages OTP input, resend logic, error handling, and redirection after success.useHandleRegisterV3
: Updated to handle user state more clearly and callssignIn()
to refresh the session after registration.
UI Integration
- Replaced outdated hooks in the login and OTP pages with
useHandleLoginV2
anduseOTPVerificationV2
, providing consistent and reliable authentication behavior. - Enhanced OTP verification UI with improved error messages, responsive feedback, and refined display of user email and verification status.
Dependency Updates
- Added
framer-motion
topackage.json
, enabling smoother transitions and animations in the user interface.
v0.11.0
The main focus of this release is the implementation of the registerUserWithOtp
GraphQL mutation. This enables full user registration using OTP verification.
Key Changes
New Mutation (registerUserWithOtp
)
- Added a new GraphQL mutation that allows users to register using OTP.
- Includes schema definition, resolver implementation, and API integration.
Redis OTP Key Format
- Updated OTP storage in Redis to use hashed email keys.
- Affects both
sendOtp
andverifyOtp
mutations.
Frontend Update
- Introduced a new
useHandleRegisterV3
hook. - Replaced the previous registration logic on the signup page.
Backend Service
- Added
createUserService
, which handles:- Hashing passwords using Argon2
- Generating unique student IDs
- Creating users with MongoDB session support
v0.10.0
232 code cleanup
V0.9.0
v0.9.0 release/v0.8.0
v0.8.0
improve course
v0.7.0
[Snyk] Upgrade create from 0.1.0-alpha.15 to 0.5.4
v0.6.0
171 refactor auth layout and isolate signup
v0.5.0
Feature/admin dashboard business metrics
v0.4.0
auth rate limiting setup
v0.3.0
Release Notes: v0.3.0
Summary
Version 0.3.0 focuses on implementing essential student-facing features, including dynamic course and lesson pages and a robust payment integration system. These updates aim to improve the user experience and streamline content access based on payment and enrollment status.
Goals
1. Dynamic Course Management
- Create dynamic course listing and details pages.
- Ensure clear navigation and content presentation for students.
2. Payment Integration
- Restrict access to unpaid users.
- Enable seamless payment workflows for course enrollment.
New Features
1. Courses Page
Route: /dashboard/home
Purpose: This page lists all available courses for students to browse.
Features:
frontend/user-get-all-course
#87
2. Course Details Page
Route: /courses/[slug]
Purpose: This page provides detailed information about a specific course.
Features:
frontend/user-get-course
#89- Display course title, description, price, sections, and lessons.
- Show "Enroll Now" or "Start Course" buttons based on user status.
3. Payment Integration
Seamlessly integrate payment workflows to enable access to paid content.
API
create-payment-mutation
(Төлбөр үүсгэх) #92update-payment-status-mutation
(Төлбөрийн төлөв шинэчлэх) #94get-all-payment-query
(Бүх төлбөрийг авах)get-payment-by-id-query
(Нэг төлбөрийн мэдээллийг авах)
Frontend
- Connect
createPayment
API to the frontend #98 - Create
getAllPayment
API and connect to the frontend #100 - Setup
updatePaymentStatus
in frontend #102 - Payment status pending UI #104
Features & Fixes
1. Update Enrollment Status after Successful Payment
Issue: fix payment status
#106
- If a user successfully completes a payment, update the enrollment status:
PENDING → APPROVED
- Ensure changes are correctly stored in the database.
2. Send a "Welcome" Email After Successful Payment
- Send an automatic email confirmation when a payment is successful.
- The email should include:
- Payment confirmation details
- Course access information
Fixes
Technical Requirements
1. Backend
Enrollment Validation:
- Middleware to validate enrollment status for courses and lessons.
Payment Integration:
- Backend logic for processing payments and updating enrollment status.
2. Frontend
Dynamic Pages:
/courses
→ Display all courses dynamically./courses/[slug]
→ Show detailed information about a specific course.
Conclusion
Version 0.3.0 will significantly improve the student experience by allowing dynamic course discovery, lesson access, and seamless payments. This update will ensure only enrolled students access premium content while enhancing backend validation and payment workflows.