mirror of
https://github.com/mCaptcha/mCaptcha.git
synced 2026-02-12 10:35:39 +00:00
dupe email check and notifications table
This commit is contained in:
@@ -182,7 +182,7 @@ pub mod runners {
|
||||
if msg.contains("mcaptcha_users_name_key") {
|
||||
return Err(ServiceError::UsernameTaken);
|
||||
} else if msg.contains("mcaptcha_users_email_key") {
|
||||
return Err(ServiceError::UsernameTaken);
|
||||
return Err(ServiceError::EmailTaken);
|
||||
} else if msg.contains("mcaptcha_users_secret_key") {
|
||||
continue;
|
||||
} else {
|
||||
|
||||
@@ -59,7 +59,7 @@ async fn auth_works() {
|
||||
signin(EMAIL, PASSWORD).await;
|
||||
|
||||
// 2. check if duplicate username is allowed
|
||||
let msg = Register {
|
||||
let mut msg = Register {
|
||||
username: NAME.into(),
|
||||
password: PASSWORD.into(),
|
||||
confirm_password: PASSWORD.into(),
|
||||
@@ -75,6 +75,18 @@ async fn auth_works() {
|
||||
)
|
||||
.await;
|
||||
|
||||
let name = format!("{}dupemail", NAME);
|
||||
msg.username = name;
|
||||
bad_post_req_test(
|
||||
NAME,
|
||||
PASSWORD,
|
||||
ROUTES.auth.register,
|
||||
&msg,
|
||||
ServiceError::EmailTaken,
|
||||
StatusCode::BAD_REQUEST,
|
||||
)
|
||||
.await;
|
||||
|
||||
// 3. sigining in with non-existent user
|
||||
let mut creds = Login {
|
||||
login: "nonexistantuser".into(),
|
||||
|
||||
Reference in New Issue
Block a user