mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-07-24 15:49:39 +02:00
Feature: Implement Mobile Responsiveness (#2092)
* WIP * WIP * WIP * WIP * WIP * WIP * WIP * format * WIP * WIP * WIP * WIP * WIP * WIP * WIP * WIP * WIP * WIP * WIP * WIP * WIP * WIP * WIP * WIP * WIP * WIP * WIP * WIP * WIP * WIP * WIP * WIP * WIP * WIP * WIP * WIP * WIP * WIP * WIP * WIP * WIP * fix conflict * fix conflict * chore: run rubocop * fix test * update PWA logo * fix tests * chore: lint * fix test * Refactor: Remove duplicate data attribute in activity partial and add chat form rendering in chats index --------- Co-authored-by: Josh Pigford <josh@joshpigford.com>
This commit is contained in:
parent
6a21f26d2d
commit
65e1bc6edd
91 changed files with 1333 additions and 527 deletions
|
@ -6,6 +6,7 @@ class RegistrationsController < ApplicationController
|
|||
before_action :set_user, only: :create
|
||||
before_action :set_invitation
|
||||
before_action :claim_invite_code, only: :create, if: :invite_code_required?
|
||||
before_action :validate_password_requirements, only: :create
|
||||
|
||||
def new
|
||||
@user = User.new(email: @invitation&.email)
|
||||
|
@ -53,4 +54,29 @@ class RegistrationsController < ApplicationController
|
|||
redirect_to new_registration_path, alert: t("registrations.create.invalid_invite_code")
|
||||
end
|
||||
end
|
||||
|
||||
def validate_password_requirements
|
||||
password = user_params[:password]
|
||||
return if password.blank? # Let Rails built-in validations handle blank passwords
|
||||
|
||||
if password.length < 8
|
||||
@user.errors.add(:password, "must be at least 8 characters")
|
||||
end
|
||||
|
||||
unless password.match?(/[A-Z]/) && password.match?(/[a-z]/)
|
||||
@user.errors.add(:password, "must include both uppercase and lowercase letters")
|
||||
end
|
||||
|
||||
unless password.match?(/\d/)
|
||||
@user.errors.add(:password, "must include at least one number")
|
||||
end
|
||||
|
||||
unless password.match?(/[!@#$%^&*(),.?":{}|<>]/)
|
||||
@user.errors.add(:password, "must include at least one special character")
|
||||
end
|
||||
|
||||
if @user.errors.present?
|
||||
render :new, status: :unprocessable_entity
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue