Browse Source

Update few hardcoded errors

pull/2628/head
Kat 2 years ago
parent
commit
d199312c08
  1. 6
      app/controllers/auth/sessions_controller.rb

6
app/controllers/auth/sessions_controller.rb

@ -4,12 +4,12 @@ class Auth::SessionsController < Devise::SessionsController
def create
self.resource = User.new
if params.dig("user", "email").empty?
resource.errors.add :email, "Enter an email address"
resource.errors.add :email, "Enter an email address."
elsif !email_valid?(params.dig("user", "email"))
resource.errors.add :email, "Enter an email address in the correct format, like name@example.com"
resource.errors.add :email, "Enter an email address in the correct format, like name@example.com."
end
if params.dig("user", "password").empty?
resource.errors.add :password, "Enter a password"
resource.errors.add :password, "Enter a password."
end
if resource.errors.present?
render :new, status: :unprocessable_entity

Loading…
Cancel
Save