Skip to content

Displaying the required page when trying to login if the account was deleted by the admin #217

Closed Answered by janko
Halvanhelv asked this question in Q&A
Discussion options

You must be logged in to vote

That's not going to automatically work, because you'd have to use password_match?, which relies on @account being loaded into the Rodauth instance. That's normally done by account_from_login, but we were skipping it here.

Maybe try the following approach:

before_login_route do
  if request.post?
    @account = account_table_ds.first(email: param(login_param), status: account_closed_status_value)
    if @account && password_match?(param(password_param))
      response.status = no_matching_login_error_status
      return_response view("account_closed", "Account closed by admin")
    end
  end
end

Replies: 2 comments 10 replies

Comment options

You must be logged in to vote
6 replies
@janko
Comment options

@Halvanhelv
Comment options

@janko
Comment options

@Halvanhelv
Comment options

@janko
Comment options

Comment options

You must be logged in to vote
4 replies
@janko
Comment options

Answer selected by Halvanhelv
@Halvanhelv
Comment options

@janko
Comment options

@Halvanhelv
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants