Skip to content

Commit eb51dd4

Browse files
committed
fix: OIDC auth with MFA
clear the path before submitting TOTP code
1 parent 8bf7cb5 commit eb51dd4

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

library/oidc.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -477,8 +477,8 @@ static void auth_cb(tlsuv_http_resp_t *http_resp, void *ctx) {
477477
path = "/oidc/login/cert";
478478
}
479479
ZITI_LOG(DEBUG, "login with path[%s] ", path);
480-
tlsuv_http_set_path_prefix(&req->clt->http, path);
481-
tlsuv_http_req_t *login_req = tlsuv_http_req(&req->clt->http, "POST", NULL, login_cb, req);
480+
tlsuv_http_set_path_prefix(&req->clt->http, NULL);
481+
tlsuv_http_req_t *login_req = tlsuv_http_req(&req->clt->http, "POST", path, login_cb, req);
482482
if (req->clt->jwt_token_auth) {
483483
tlsuv_http_req_header(login_req, "Authorization", req->clt->jwt_token_auth);
484484
}
@@ -844,7 +844,7 @@ int oidc_client_token(oidc_client_t *clt, const char *token) {
844844
int oidc_client_mfa(oidc_client_t *clt, const char *code) {
845845
struct auth_req *req = clt->request;
846846
assert(req);
847-
847+
tlsuv_http_set_path_prefix(&clt->http, NULL);
848848
tlsuv_http_req_t *r = tlsuv_http_req(&clt->http, "POST", "/oidc/login/totp", on_totp, req);
849849
tlsuv_http_req_form(r, 2, (tlsuv_http_pair[]){
850850
{"id", req->id},

0 commit comments

Comments
 (0)