@@ -213,7 +213,8 @@ 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_validate_email == NULL || jwtcf -> auth_jwt_validate_email )
216
+ // if (jwtcf->auth_jwt_validate_email == NULL || jwtcf->auth_jwt_validate_email == 1)
217
+ if (jwtcf -> auth_jwt_validate_email == 1 )
217
218
{
218
219
email = jwt_get_grant (jwt , "emailAddress" );
219
220
if (email == NULL )
@@ -355,7 +356,7 @@ ngx_http_auth_jwt_create_loc_conf(ngx_conf_t *cf)
355
356
// set the flag to unset
356
357
conf -> auth_jwt_enabled = (ngx_flag_t ) - 1 ;
357
358
conf -> auth_jwt_redirect = (ngx_flag_t ) - 1 ;
358
- conf -> auth_jwt_validate_email = (ngx_flag_t ) - 1 ;
359
+ // conf->auth_jwt_validate_email = (ngx_flag_t) -1;
359
360
360
361
ngx_conf_log_error (NGX_LOG_DEBUG , cf , 0 , "Created Location Configuration" );
361
362
@@ -372,7 +373,8 @@ ngx_http_auth_jwt_merge_loc_conf(ngx_conf_t *cf, void *parent, void *child)
372
373
ngx_conf_merge_str_value (conf -> auth_jwt_loginurl , prev -> auth_jwt_loginurl , "" );
373
374
ngx_conf_merge_str_value (conf -> auth_jwt_key , prev -> auth_jwt_key , "" );
374
375
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 , "" );
376
+ ngx_conf_merge_str_value (conf -> auth_jwt_algorithm , prev -> auth_jwt_algorithm , "HS256" );
377
+ ngx_conf_merge_off_value (conf -> auth_jwt_validate_email , prev -> auth_jwt_validate_email , 1 );
376
378
377
379
if (conf -> auth_jwt_enabled == ((ngx_flag_t ) - 1 ))
378
380
{
@@ -384,11 +386,6 @@ ngx_http_auth_jwt_merge_loc_conf(ngx_conf_t *cf, void *parent, void *child)
384
386
conf -> auth_jwt_redirect = (prev -> auth_jwt_redirect == ((ngx_flag_t ) - 1 )) ? 0 : prev -> auth_jwt_redirect ;
385
387
}
386
388
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
-
392
389
return NGX_CONF_OK ;
393
390
}
394
391
0 commit comments