Skip to content

Commit

Permalink
ProviderConfiguration: Use ClientRegistrationInfo for client_registra…
Browse files Browse the repository at this point in the history
…tion_info
  • Loading branch information
Mstrodl committed Oct 29, 2024
1 parent 9675152 commit c0b12cb
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions profiles/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@
import ldap
import sentry_sdk

from werkzeug.exceptions import NotFound
from flask import Flask, flash, jsonify, redirect, render_template, request
from flask_pyoidc.flask_pyoidc import OIDCAuthentication
from flask_pyoidc.provider_configuration import ProviderConfiguration
from flask_pyoidc.provider_configuration import ProviderConfiguration, ClientRegistrationInfo
from flask_sqlalchemy import SQLAlchemy
from flask_uploads import IMAGES, UploadSet, configure_uploads
from sentry_sdk.integrations.flask import FlaskIntegration
Expand All @@ -25,7 +26,9 @@
{
'default': ProviderConfiguration(
issuer=app.config["OIDC_ISSUER"],
client_registration_info=app.config["OIDC_CLIENT_CONFIG"],
client_registration_info=ClientRegistrationInfo(
**app.config["OIDC_CLIENT_CONFIG"]
)
)
},
app,
Expand Down Expand Up @@ -187,6 +190,8 @@ def clear_cache(info=None):
@app.errorhandler(404)
@app.errorhandler(500)
def handle_internal_error(e):
if isinstance(e, NotFound):
return render_template("404.html", message=str(e)), 404
if isinstance(e.original_exception, BadQueryError):
return render_template("404.html", message=e.original_exception), 404
raise e.original_exception
Expand Down

0 comments on commit c0b12cb

Please sign in to comment.