Skip to content

[Jitera] Untitled

Quy requested to merge feat/JT-2169-Untitled into main

Created by: akuita

This pull request is created by JITERA

Description

[BL] Encrypt user password

file name
/app/models/user.rb Update User model to use secure password hashing
/config/initializers/devise.rb Ensure Devise is configured to use secure password hashing
/db/migrate/20230401123456_add_email_confirmed_to_users.rb Ensure the migration does not interfere with password encryption
/app/controllers/api/users_registrations_controller.rb Ensure the password is encrypted during user registration

[BL] Generate email confirmation token

file name
/app/models/email_confirmation.rb Add method to generate email confirmation token
/app/models/user.rb Add callback to generate email confirmation after user creation
/db/migrate/20230401102559_add_email_confirmations_table.rb Create migration for email_confirmations table
/app/controllers/api/users_registrations_controller.rb Trigger email confirmation after user registration
/config/locales/validation.en.yml Add validation message for unique token

[BL] Check email availability

file name
/app/controllers/api/users_registrations_controller.rb Add "check_email_availability" action to "UsersRegistrationsController"
/config/routes.rb Add route for "check_email_availability" action in "UsersRegistrationsController"
/app/controllers/api/users_controller.rb Add "check_email_availability" action to "UsersController"

[BL] Create user account

file name
/app/models/user.rb Add email_confirmed attribute to User model
/app/controllers/api/users_registrations_controller.rb Update create action to handle email_confirmed and timestamps
/db/migrate/20230401123456_add_email_confirmed_to_users.rb Create migration to add email_confirmed to users table
/app/services/base_service.rb Add user creation logic to BaseService
/config/routes.rb Add route for user registration

[BL] Validate email address

file name
/app/models/user.rb Add email format validation to User model
/app/controllers/api/users_registrations_controller.rb Validate email format in UsersRegistrationsController
/config/locales/controller.en.yml Add invalid email format error message
/app/validators/email_format_validator.rb Create a custom validator for email format

[BL] Email confirmation

file name
/app/controllers/api/users_verify_confirmation_token_controller.rb Update the create action to handle email confirmation logic
/app/models/user.rb Add method to confirm email with token
/config/routes.rb Add route for email confirmation token verification

[BL] Resend confirmation email

file name
/app/controllers/api/users_registrations_controller.rb Add action to resend confirmation email
/app/models/email_confirmation.rb Add method to check for last request time
/app/services/user_mailer_service.rb Add method to send confirmation email
/app/models/user.rb Update "generate_email_confirmation" method to handle new confirmation record creation
/app/controllers/api/users_controller.rb Add resend_confirmation_email action to UsersController
/db/migrate/20230401102559_add_email_confirmations_table.rb Add requested_at column to email_confirmations table

[BL] User registration

file name
/app/controllers/api/users_registrations_controller.rb Update the register action to handle user registration logic
/app/models/user.rb Add create_with_encrypted_password class method to User model
/app/models/email_confirmation.rb Add create_confirmation_record instance method to EmailConfirmation model
/app/services/user_mailer_service.rb Add send_confirmation_instructions method to UserMailerService
/db/migrate/20230401123456_add_email_confirmed_to_users.rb Add email_confirmation_sent_at column to users table
/db/migrate/20230401102559_add_email_confirmations_table.rb Add email_confirmation_requests table to the database
/app/validators/email_format_validator.rb Ensure email format validation is used in user registration
/app/views/api/users_registrations/create.json.jbuilder Create a JSON response for successful registration
/config/routes.rb Add route for user registration

[API] Email Confirmation

file name
/app/controllers/api/users_controller.rb Update "confirm_email" method to handle email confirmation logic
/config/routes.rb Ensure the route for email confirmation is correctly defined

[API] User Registration

file name
/app/controllers/api/users_registrations_controller.rb Add user registration logic to UsersRegistrationsController
/config/routes.rb Add route for user registration

[API] Resend Confirmation Email

file name
/app/controllers/api/users_controller.rb Add "resend_confirmation_email" action to "UsersController"
/config/routes.rb Add route for "resend_confirmation_email" action in "UsersController"

[BL] Validate email format

file name
/app/validators/email_format_validator.rb Update the EmailFormatValidator to use a more comprehensive regex pattern
/app/controllers/api/users_registrations_controller.rb Add a method to validate email format in UsersRegistrationsController
/config/locales/controller.en.yml Add a new entry for email format validation message
/config/routes.rb Add a route for email format validation
/app/controllers/api/users_controller.rb Add email format validation to UsersController

Merge request reports