Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 0b12ded1cf | |||
| 0296cf9c51 | |||
| 604b31b937 | |||
| 89e572faf8 | |||
| 78f5304214 |
@ -12,7 +12,7 @@ members = [
|
||||
]
|
||||
|
||||
[workspace.package]
|
||||
version = "0.1.9"
|
||||
version = "0.2.2"
|
||||
edition = "2021"
|
||||
authors = ["Echo <echo@moon-dragon.us>"]
|
||||
license = "MIT"
|
||||
|
||||
@ -120,7 +120,7 @@ pub async fn login(
|
||||
let user: Option<DbUser> = sqlx::query_as(
|
||||
r#"
|
||||
SELECT id, username, display_name, role, auth_provider,
|
||||
password_hash, totp_secret, mfa_enabled, is_active, force_password_reset,
|
||||
password_hash, totp_secret_encrypted, totp_secret_nonce, mfa_enabled, is_active, force_password_reset,
|
||||
failed_login_attempts, locked_until
|
||||
FROM users
|
||||
WHERE username = $1 AND auth_provider = 'local'
|
||||
@ -278,7 +278,7 @@ pub async fn refresh_session(
|
||||
let user: DbUser = sqlx::query_as(
|
||||
r#"
|
||||
SELECT id, username, display_name, role, auth_provider,
|
||||
password_hash, totp_secret, mfa_enabled, is_active, force_password_reset,
|
||||
password_hash, totp_secret_encrypted, totp_secret_nonce, mfa_enabled, is_active, force_password_reset,
|
||||
failed_login_attempts, locked_until
|
||||
FROM users WHERE id = $1
|
||||
"#,
|
||||
|
||||
@ -553,7 +553,7 @@ impl CertAuthority {
|
||||
FROM certificates \
|
||||
WHERE status = 'revoked'::cert_status \
|
||||
AND revoked_at IS NOT NULL \
|
||||
AND not_after > NOW() \
|
||||
AND expires_at > NOW() \
|
||||
ORDER BY revoked_at ASC",
|
||||
)
|
||||
.fetch_all(db)
|
||||
|
||||
@ -435,7 +435,7 @@ async fn disable_mfa(
|
||||
));
|
||||
}
|
||||
|
||||
sqlx::query("UPDATE users SET totp_secret = NULL, mfa_enabled = FALSE WHERE id = $1")
|
||||
sqlx::query("UPDATE users SET totp_secret_encrypted = NULL, totp_secret_nonce = NULL, mfa_enabled = FALSE WHERE id = $1")
|
||||
.bind(auth_user.user_id)
|
||||
.execute(&state.db)
|
||||
.await
|
||||
|
||||
Reference in New Issue
Block a user