Update DashboardOIDC.py

This commit is contained in:
Donald Zou 2025-07-02 18:59:41 +08:00
parent 08a41f8f68
commit 2987216169

View File

@ -9,7 +9,7 @@ class DashboardOIDC:
ConfigurationPath = os.getenv('CONFIGURATION_PATH', '.') ConfigurationPath = os.getenv('CONFIGURATION_PATH', '.')
ConfigurationFilePath = os.path.join(ConfigurationPath, 'wg-dashboard-oidc-providers.json') ConfigurationFilePath = os.path.join(ConfigurationPath, 'wg-dashboard-oidc-providers.json')
def __init__(self): def __init__(self):
self.providers: dict[str, dict] = None self.providers: dict[str, dict] = {}
self.__default = { self.__default = {
'Provider': { 'Provider': {
'client_id': '', 'client_id': '',
@ -107,6 +107,7 @@ class DashboardOIDC:
self.providers = decoder.decode( self.providers = decoder.decode(
open(DashboardOIDC.ConfigurationFilePath, 'r').read() open(DashboardOIDC.ConfigurationFilePath, 'r').read()
) )
print(self.providers)
except Exception as e: except Exception as e:
current_app.logger.error('Read OIDC file failed. Reason: ' + str(e)) current_app.logger.error('Read OIDC file failed. Reason: ' + str(e))
return False return False