|
4 | 4 | import ldap |
5 | 5 | import sentry_sdk |
6 | 6 |
|
| 7 | +from werkzeug.exceptions import NotFound |
7 | 8 | from flask import Flask, flash, jsonify, redirect, render_template, request |
8 | 9 | from flask_pyoidc.flask_pyoidc import OIDCAuthentication |
9 | | -from flask_pyoidc.provider_configuration import ProviderConfiguration |
| 10 | +from flask_pyoidc.provider_configuration import ProviderConfiguration, ClientRegistrationInfo |
10 | 11 | from flask_sqlalchemy import SQLAlchemy |
11 | 12 | from flask_uploads import IMAGES, UploadSet, configure_uploads |
12 | 13 | from sentry_sdk.integrations.flask import FlaskIntegration |
|
25 | 26 | { |
26 | 27 | 'default': ProviderConfiguration( |
27 | 28 | issuer=app.config["OIDC_ISSUER"], |
28 | | - client_registration_info=app.config["OIDC_CLIENT_CONFIG"], |
| 29 | + client_registration_info=ClientRegistrationInfo( |
| 30 | + **app.config["OIDC_CLIENT_CONFIG"] |
| 31 | + ) |
29 | 32 | ) |
30 | 33 | }, |
31 | 34 | app, |
@@ -187,6 +190,8 @@ def clear_cache(info=None): |
187 | 190 | @app.errorhandler(404) |
188 | 191 | @app.errorhandler(500) |
189 | 192 | def handle_internal_error(e): |
| 193 | + if isinstance(e, NotFound): |
| 194 | + return render_template("404.html", message=str(e)), 404 |
190 | 195 | if isinstance(e.original_exception, BadQueryError): |
191 | 196 | return render_template("404.html", message=e.original_exception), 404 |
192 | 197 | raise e.original_exception |
|
0 commit comments