Skip to content

Commit cfea570

Browse files
committed
allow options requests
I've started using a different subdomain for my front end and back end. This has made my app perofrm CORS OPTIONS requests. When the request is made, it does not pass the token! I considered configuring NGINX to handle the OPTIONS requests, but I'd rather let my app handle it.
1 parent 0686f3a commit cfea570

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/ngx_http_auth_jwt_module.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,12 @@ static ngx_int_t ngx_http_auth_jwt_handler(ngx_http_request_t *r)
147147
{
148148
return NGX_DECLINED;
149149
}
150+
151+
// pass through options requests without token authentication
152+
if (r->method == NGX_HTTP_OPTIONS)
153+
{
154+
return NGX_DECLINED;
155+
}
150156

151157
jwtCookieValChrPtr = getJwt(r, jwtcf->auth_jwt_validation_type);
152158
if (jwtCookieValChrPtr == NULL)

0 commit comments

Comments
 (0)