@@ -23,7 +23,7 @@ typedef struct {
23
23
ngx_str_t auth_jwt_key ;
24
24
ngx_flag_t auth_jwt_enabled ;
25
25
ngx_flag_t auth_jwt_redirect ;
26
- ngx_flag_t auth_jwt_email_validation ;
26
+ ngx_flag_t auth_jwt_validate_email ;
27
27
ngx_str_t auth_jwt_validation_type ;
28
28
ngx_str_t auth_jwt_algorithm ;
29
29
@@ -65,11 +65,11 @@ static ngx_command_t ngx_http_auth_jwt_commands[] = {
65
65
offsetof(ngx_http_auth_jwt_loc_conf_t , auth_jwt_redirect ),
66
66
NULL },
67
67
68
- { ngx_string ("auth_jwt_email_validation " ),
68
+ { ngx_string ("auth_jwt_validate_email " ),
69
69
NGX_HTTP_MAIN_CONF |NGX_HTTP_SRV_CONF |NGX_HTTP_LOC_CONF |NGX_CONF_FLAG ,
70
70
ngx_conf_set_flag_slot ,
71
71
NGX_HTTP_LOC_CONF_OFFSET ,
72
- offsetof(ngx_http_auth_jwt_loc_conf_t , auth_jwt_email_validation ),
72
+ offsetof(ngx_http_auth_jwt_loc_conf_t , auth_jwt_validate_email ),
73
73
NULL },
74
74
75
75
{ ngx_string ("auth_jwt_validation_type" ),
@@ -213,7 +213,7 @@ static ngx_int_t ngx_http_auth_jwt_handler(ngx_http_request_t *r)
213
213
set_custom_header_in_headers_out (r , & useridHeaderName , & sub_t );
214
214
}
215
215
216
- if (jwtcf -> auth_jwt_email_validation == NULL || !jwtcf -> auth_jwt_email_validation )
216
+ if (jwtcf -> auth_jwt_validate_email == NULL || !jwtcf -> auth_jwt_validate_email )
217
217
{
218
218
email = jwt_get_grant (jwt , "emailAddress" );
219
219
if (email == NULL )
@@ -355,6 +355,7 @@ ngx_http_auth_jwt_create_loc_conf(ngx_conf_t *cf)
355
355
// set the flag to unset
356
356
conf -> auth_jwt_enabled = (ngx_flag_t ) - 1 ;
357
357
conf -> auth_jwt_redirect = (ngx_flag_t ) - 1 ;
358
+ conf -> auth_jwt_validate_email = (ngx_flag_t ) - 1 ;
358
359
359
360
ngx_conf_log_error (NGX_LOG_DEBUG , cf , 0 , "Created Location Configuration" );
360
361
@@ -371,6 +372,7 @@ ngx_http_auth_jwt_merge_loc_conf(ngx_conf_t *cf, void *parent, void *child)
371
372
ngx_conf_merge_str_value (conf -> auth_jwt_loginurl , prev -> auth_jwt_loginurl , "" );
372
373
ngx_conf_merge_str_value (conf -> auth_jwt_key , prev -> auth_jwt_key , "" );
373
374
ngx_conf_merge_str_value (conf -> auth_jwt_validation_type , prev -> auth_jwt_validation_type , "" );
375
+ ngx_conf_merge_str_value (conf -> auth_jwt_algorithm , prev -> auth_jwt_algorithm , "" );
374
376
375
377
if (conf -> auth_jwt_enabled == ((ngx_flag_t ) - 1 ))
376
378
{
@@ -382,6 +384,11 @@ ngx_http_auth_jwt_merge_loc_conf(ngx_conf_t *cf, void *parent, void *child)
382
384
conf -> auth_jwt_redirect = (prev -> auth_jwt_redirect == ((ngx_flag_t ) - 1 )) ? 0 : prev -> auth_jwt_redirect ;
383
385
}
384
386
387
+ if (conf -> auth_jwt_validate_email == ((ngx_flag_t ) - 1 ))
388
+ {
389
+ conf -> auth_jwt_validate_email = (prev -> auth_jwt_validate_email == ((ngx_flag_t ) - 1 )) ? 0 : prev -> auth_jwt_validate_email ;
390
+ }
391
+
385
392
return NGX_CONF_OK ;
386
393
}
387
394
0 commit comments