]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
auth: db-oauth2 - Change active:false to mean invalid token
authorAki Tuomi <aki.tuomi@open-xchange.com>
Thu, 22 Oct 2020 08:42:23 +0000 (11:42 +0300)
committerAki Tuomi <aki.tuomi@open-xchange.com>
Tue, 3 Nov 2020 18:29:52 +0000 (20:29 +0200)
Specifications say that invalid token, expired token and any other
reason why the token can be considered invalid should return
{"active":false} reply with no other fields.

Thus, we need to consider this as invalid token.

src/auth/db-oauth2.c

index 0b63fea95d4b341a42af2055248307859bf32ca7..ddbe336b35c9c74e41463acb81c8eedfca94d8f3 100644 (file)
@@ -545,8 +545,8 @@ db_oauth2_user_is_enabled(struct db_oauth2_request *req,
                if (active_value == NULL ||
                    (*req->db->set.active_value != '\0' &&
                     strcmp(req->db->set.active_value, active_value) != 0)) {
-                       *error_r = "User account is not active";
-                       *result_r = PASSDB_RESULT_USER_DISABLED;
+                       *error_r = "Provided token is not valid";
+                       *result_r = PASSDB_RESULT_PASSWORD_MISMATCH;
                        return FALSE;
                }
        }