Skip to content
Snippets Groups Projects
Commit 6882134a authored by Egor Ivkov's avatar Egor Ivkov Committed by Егор Ивков
Browse files

refactor: check user existence earlier in on_auth trigger

parent e5849866
No related branches found
No related tags found
1 merge request!851fix: panic after revoke login
Pipeline #32464 passed
......@@ -318,10 +318,6 @@ fn set_login_check(storage: Clusterwide) {
// Switch to admin to access system spaces.
let admin_guard = session::su(ADMIN_ID).expect("switching to admin should not fail");
let max_login_attempts = storage
.properties
.max_login_attempts()
.expect("accessing storage should not fail");
let Some(user) = storage
.users
.by_name(&user_name)
......@@ -332,6 +328,10 @@ fn set_login_check(storage: Clusterwide) {
debug_assert!(!successful_authentication);
return Verdict::UnknownUser;
};
let max_login_attempts = storage
.properties
.max_login_attempts()
.expect("accessing storage should not fail");
if storage
.privileges
.get(user.id, "universe", 0, "login")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment