Skip to content

Commit

Permalink
Set flash notifications if message is not nil
Browse files Browse the repository at this point in the history
  • Loading branch information
igor-alexandrov committed Oct 22, 2023
1 parent 608b329 commit 32094fe
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions lib/rodauth/features/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ module Rodauth
auth_value_method :mark_input_fields_with_inputmode?, true
auth_value_method :skip_status_checks?, true
auth_value_method :template_opts, {}.freeze
auth_value_method :title_instance_variable, nil
auth_value_method :title_instance_variable, nil
auth_value_method :token_separator, "_"
auth_value_method :unmatched_field_error_status, 422
auth_value_method :unopen_account_error_status, 403
Expand Down Expand Up @@ -278,7 +278,7 @@ def account_from_login(login)
end

def open_account?
skip_status_checks? || account[account_status_column] == account_open_status_value
skip_status_checks? || account[account_status_column] == account_open_status_value
end

def db
Expand Down Expand Up @@ -339,19 +339,19 @@ def set_title(title)
end

def set_error_flash(message)
flash.now[flash_error_key] = message
flash.now[flash_error_key] = message if message
end

def set_redirect_error_flash(message)
flash[flash_error_key] = message
flash[flash_error_key] = message if message
end

def set_notice_flash(message)
flash[flash_notice_key] = message
flash[flash_notice_key] = message if message
end

def set_notice_now_flash(message)
flash.now[flash_notice_key] = message
flash.now[flash_notice_key] = message if message
end

def require_login
Expand Down Expand Up @@ -448,7 +448,7 @@ def password_match?(password)
password_hash_match?(hash, password)
else
database_function_password_match?(:rodauth_valid_password_hash, account_id, password, hash)
end
end
end
end

Expand Down Expand Up @@ -636,7 +636,7 @@ def set_redirect_error_status(status)
def set_response_error_status(status)
response.status = status
end

def set_response_error_reason_status(reason, status)
set_error_reason(reason)
set_response_error_status(status)
Expand Down

0 comments on commit 32094fe

Please sign in to comment.