Capacitor pre-fetch request in JWT Authentication flow
-
We are using this plugin for JTW API Authentication. We are consuming the API through a capacitor application but capacitor sends a pre-fetch request to the API leading to a 401 MISSING_AUTHORIZATION_HEADER on this request.
We have patched your code to bypass this error:
class Mo_API_Authentication_JWT_Auth (line 67):
} elseif ( ( isset( $headers[‘ORIGIN’] ) && strpos($headers[‘ORIGIN’], ‘capacitor’) !== false) ||
( isset( $headers[‘ACCESS-CONTROL-REQUEST-HEADERS’] ) && strcasecmp($headers[‘SEC-FETCH-MODE’], ‘cors’ ) === 0 ) ) {
return true;
}I think you can patch your code to get this working.
You must be logged in to reply to this topic.