Skip to content

Commit

Permalink
fix password hint check
Browse files Browse the repository at this point in the history
don't show password hints if you have disabled the hints with
PASSWORD_HINTS_ALLOWED=false or if you have not configured mail and
opted into showing password hints
  • Loading branch information
stefan0xC committed Nov 12, 2024
1 parent e927b8a commit b224721
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/api/core/accounts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -842,7 +842,7 @@ struct PasswordHintData {

#[post("/accounts/password-hint", data = "<data>")]
async fn password_hint(data: Json<PasswordHintData>, mut conn: DbConn) -> EmptyResult {
if !CONFIG.mail_enabled() || !CONFIG.show_password_hint() {
if !CONFIG.password_hints_allowed() || (!CONFIG.mail_enabled() && !CONFIG.show_password_hint()) {
err!("This server is not configured to provide password hints.");
}

Expand Down

0 comments on commit b224721

Please sign in to comment.