From 2a9e187c4b8d548f97d67380b2ebd38f3d494fb8 Mon Sep 17 00:00:00 2001 From: Ahmed Fwela Date: Sat, 8 Jun 2024 08:11:27 +0300 Subject: [PATCH 1/3] fix logout options not being used --- .../lib/src/managers/user_manager_base.dart | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/packages/oidc_core/lib/src/managers/user_manager_base.dart b/packages/oidc_core/lib/src/managers/user_manager_base.dart index fdd0d9e..3c41a14 100644 --- a/packages/oidc_core/lib/src/managers/user_manager_base.dart +++ b/packages/oidc_core/lib/src/managers/user_manager_base.dart @@ -137,6 +137,14 @@ abstract class OidcUserManagerBase { required OidcMonitorSessionStatusRequest request, }); + OidcPlatformSpecificOptions getOptions( + OidcPlatformSpecificOptions? optionsOverride, + ) { + return optionsOverride ?? + settings.options ?? + const OidcPlatformSpecificOptions(); + } + /// Attempts to login the user via the AuthorizationCodeFlow. /// /// [originalUri] is the uri you want to be redirected to after authentication is done, @@ -163,7 +171,7 @@ abstract class OidcUserManagerBase { ensureInit(); final discoveryDocument = discoveryDocumentOverride ?? this.discoveryDocument; - options ??= settings.options ?? const OidcPlatformSpecificOptions(); + options = getOptions(options); final simpleReq = OidcSimpleAuthorizationCodeFlowRequest( clientId: clientCredentials.clientId, originalUri: originalUri, @@ -377,7 +385,7 @@ abstract class OidcUserManagerBase { ensureInit(); final discoveryDocument = discoveryDocumentOverride ?? this.discoveryDocument; - options ??= const OidcPlatformSpecificOptions(); + options = getOptions(options); final currentUser = this.currentUser; if (currentUser == null) { return; From e15b4edd8d3c1133cfd09cb1fb13afa8fd157830 Mon Sep 17 00:00:00 2001 From: Ahmed Fwela Date: Sat, 8 Jun 2024 08:13:58 +0300 Subject: [PATCH 2/3] rename to getPlatformOptions --- .../oidc_core/lib/src/managers/user_manager_base.dart | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/packages/oidc_core/lib/src/managers/user_manager_base.dart b/packages/oidc_core/lib/src/managers/user_manager_base.dart index 3c41a14..af71c41 100644 --- a/packages/oidc_core/lib/src/managers/user_manager_base.dart +++ b/packages/oidc_core/lib/src/managers/user_manager_base.dart @@ -137,8 +137,9 @@ abstract class OidcUserManagerBase { required OidcMonitorSessionStatusRequest request, }); - OidcPlatformSpecificOptions getOptions( - OidcPlatformSpecificOptions? optionsOverride, + @protected + OidcPlatformSpecificOptions getPlatformOptions( + [OidcPlatformSpecificOptions? optionsOverride,] ) { return optionsOverride ?? settings.options ?? @@ -171,7 +172,7 @@ abstract class OidcUserManagerBase { ensureInit(); final discoveryDocument = discoveryDocumentOverride ?? this.discoveryDocument; - options = getOptions(options); + options = getPlatformOptions(options); final simpleReq = OidcSimpleAuthorizationCodeFlowRequest( clientId: clientCredentials.clientId, originalUri: originalUri, @@ -385,7 +386,7 @@ abstract class OidcUserManagerBase { ensureInit(); final discoveryDocument = discoveryDocumentOverride ?? this.discoveryDocument; - options = getOptions(options); + options = getPlatformOptions(options); final currentUser = this.currentUser; if (currentUser == null) { return; From 29b1d046b4ddb87b26f8864715e8fa68e6b5d163 Mon Sep 17 00:00:00 2001 From: Ahmed Fwela Date: Sat, 8 Jun 2024 08:15:04 +0300 Subject: [PATCH 3/3] format --- packages/oidc_core/lib/src/managers/user_manager_base.dart | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/oidc_core/lib/src/managers/user_manager_base.dart b/packages/oidc_core/lib/src/managers/user_manager_base.dart index af71c41..7206af1 100644 --- a/packages/oidc_core/lib/src/managers/user_manager_base.dart +++ b/packages/oidc_core/lib/src/managers/user_manager_base.dart @@ -138,9 +138,9 @@ abstract class OidcUserManagerBase { }); @protected - OidcPlatformSpecificOptions getPlatformOptions( - [OidcPlatformSpecificOptions? optionsOverride,] - ) { + OidcPlatformSpecificOptions getPlatformOptions([ + OidcPlatformSpecificOptions? optionsOverride, + ]) { return optionsOverride ?? settings.options ?? const OidcPlatformSpecificOptions();