+2
-3
src/helpers.rs
+2
-3
src/helpers.rs
···
134
134
135
135
pub enum AuthResult {
136
136
WrongIdentityOrPassword,
137
-
TwoFactorRequired,
137
+
/// The string here is the email address to create a hint for oauth
138
+
TwoFactorRequired(String),
138
139
/// User does not have 2FA enabled, or using an app password, or passes it
139
140
ProxyThrough,
140
141
TokenCheckFailed(TokenCheckError),
···
242
243
.await?
243
244
}
244
245
};
245
-
246
-
//TODO maybe check password first?
247
246
248
247
if let Some((did, password_scrypt, email, handle)) = account_row {
249
248
// Verify password before proceeding to 2FA email step
+1
-1
src/oauth_provider.rs
+1
-1
src/oauth_provider.rs
···
36
36
let identifier = payload.username.clone();
37
37
let password = payload.password.clone();
38
38
let auth_factor_token = payload.email_otp.clone();
39
-
//TODO need to pass in a flag to ignore app passwords for Oauth
40
39
40
+
//TODO need to pass in a flag to ignore app passwords for Oauth
41
41
// Run the shared pre-auth logic to validate and check 2FA requirement
42
42
match preauth_check(&state, &identifier, &password, auth_factor_token).await {
43
43
Ok(result) => match result {