diff --git a/src/flask_pyoidc/flask_pyoidc.py b/src/flask_pyoidc/flask_pyoidc.py index 89ddcea..42f6a1d 100644 --- a/src/flask_pyoidc/flask_pyoidc.py +++ b/src/flask_pyoidc/flask_pyoidc.py @@ -145,7 +145,7 @@ def _handle_authentication_response(self): return self._handle_error_response({'error': 'unsolicited_response', 'error_description': 'No initialised user session.'}) if flask.session.pop('fragment_encoded_response', False): - return importlib_resources.read_binary('flask_pyoidc', 'parse_fragment.html').decode('utf-8') + return (importlib_resources.files('flask_pyoidc') / 'parse_fragment.html').read_text(encoding='utf-8') if 'auth_request' not in flask.session: return self._handle_error_response({'error': 'unsolicited_response', 'error_description': 'No authentication request stored.'})