Skip to content

Commit a71fc75

Browse files
committed
Fix for email validation option, now auth_jwt_email_validation
1 parent 82cd5de commit a71fc75

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

src/ngx_http_auth_jwt_module.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ typedef struct {
2323
ngx_str_t auth_jwt_key;
2424
ngx_flag_t auth_jwt_enabled;
2525
ngx_flag_t auth_jwt_redirect;
26+
ngx_flag_t auth_jwt_email_validation;
2627
ngx_str_t auth_jwt_validation_type;
2728
ngx_str_t auth_jwt_algorithm;
28-
ngx_flag_t auth_jwt_validate_email;
2929

3030
} ngx_http_auth_jwt_loc_conf_t;
3131

@@ -65,6 +65,13 @@ static ngx_command_t ngx_http_auth_jwt_commands[] = {
6565
offsetof(ngx_http_auth_jwt_loc_conf_t, auth_jwt_redirect),
6666
NULL },
6767

68+
{ ngx_string("auth_jwt_email_validation"),
69+
NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_FLAG,
70+
ngx_conf_set_flag_slot,
71+
NGX_HTTP_LOC_CONF_OFFSET,
72+
offsetof(ngx_http_auth_jwt_loc_conf_t, auth_jwt_email_validation),
73+
NULL },
74+
6875
{ ngx_string("auth_jwt_validation_type"),
6976
NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
7077
ngx_conf_set_str_slot,
@@ -79,13 +86,6 @@ static ngx_command_t ngx_http_auth_jwt_commands[] = {
7986
offsetof(ngx_http_auth_jwt_loc_conf_t, auth_jwt_algorithm),
8087
NULL },
8188

82-
{ ngx_string("auth_jwt_validate_email"),
83-
NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_FLAG,
84-
ngx_conf_set_flag_slot,
85-
NGX_HTTP_LOC_CONF_OFFSET,
86-
offsetof(ngx_http_auth_jwt_loc_conf_t, auth_jwt_validate_email),
87-
NULL },
88-
8989
ngx_null_command
9090
};
9191

@@ -213,7 +213,7 @@ static ngx_int_t ngx_http_auth_jwt_handler(ngx_http_request_t *r)
213213
set_custom_header_in_headers_out(r, &useridHeaderName, &sub_t);
214214
}
215215

216-
if (jwtcf->auth_jwt_validate_email == NULL || !jwtcf->auth_jwt_validate_email)
216+
if (jwtcf->auth_jwt_email_validation == NULL || !jwtcf->auth_jwt_email_validation)
217217
{
218218
email = jwt_get_grant(jwt, "emailAddress");
219219
if (email == NULL)

0 commit comments

Comments
 (0)