1
0
mirror of https://github.com/ellmau/adf-obdd.git synced 2025-12-20 09:39:38 +01:00

Enforce username and password to be set on login

This commit is contained in:
monsterkrampe 2023-04-03 17:36:38 +02:00
parent 257bd5cdfc
commit b7fd34ee48
No known key found for this signature in database
GPG Key ID: B8ADC1F5A5CE5057

View File

@ -155,6 +155,11 @@ async fn login(
) -> impl Responder {
let username = &user_data.username;
let pw = &user_data.password;
if username.is_empty() || pw.is_empty() {
return HttpResponse::BadRequest().body("Username and Password need to be set!");
}
let user_coll: mongodb::Collection<User> = app_state
.mongodb_client
.database(DB_NAME)