Are the requests being made JSON requests (does their content type include application/json or application/vnd.api.json)? It looks like the current behavior is to check that. Potentially the calls to json_request? should be changed to use_jwt?, so in json only mode it doesn't matter what the content type is.
diff --git a/lib/rodauth/features/jwt.rb b/lib/rodauth/features/jwt.rb
index fb30cf7..199e902 100644
--- a/lib/rodauth/features/jwt.rb
+++ b/lib/rodauth/features/jwt.rb
@@ -163,7 +163,7 @@ module Rodauth
def before_view_recovery_codes
super if defined?(super)
- if json_request?
+ if use_jwt?
json_response[:codes] = recovery_codes
json_response[json_response_success_key] ||= "" if include_success_messages?
end
@@ -214,13 +214,13 @@ module Rodauth
end
def set_redirect_error_status(status)
- if json_request? && json_response_custom_error_status?
+ if use_jwt? && json_response_custom_error_status?
response.status = status
end
end
def set_response_error_status(status)
- if json_request? && !json_response_custom_error_status?
+ if use_jwt? && !json_response_custom_error_status?
status = json_response_error_status
end
If you could please try that and let me know if it works for you, I would appreciate it. The current tests pass with it.
As a workaround in the current release, you could add the following to your rodauth configuration: