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