TF-1400 Fix can't logout when fcm disabled
This commit is contained in:
@@ -56,6 +56,7 @@ abstract class ReloadableController extends BaseController {
|
|||||||
|
|
||||||
GetFCMSubscriptionLocalInteractor? _getSubscriptionLocalInteractor;
|
GetFCMSubscriptionLocalInteractor? _getSubscriptionLocalInteractor;
|
||||||
DestroySubscriptionInteractor? _destroySubscriptionInteractor;
|
DestroySubscriptionInteractor? _destroySubscriptionInteractor;
|
||||||
|
bool _isFcmEnabled = false;
|
||||||
|
|
||||||
ReloadableController(
|
ReloadableController(
|
||||||
this._logoutOidcInteractor,
|
this._logoutOidcInteractor,
|
||||||
@@ -178,7 +179,9 @@ abstract class ReloadableController extends BaseController {
|
|||||||
]);
|
]);
|
||||||
_authorizationInterceptors.clear();
|
_authorizationInterceptors.clear();
|
||||||
_authorizationIsolateInterceptors.clear();
|
_authorizationIsolateInterceptors.clear();
|
||||||
_fcmReceiver.deleteFcmToken();
|
if (_isFcmEnabled) {
|
||||||
|
_fcmReceiver.deleteFcmToken();
|
||||||
|
}
|
||||||
await _cachingManager.closeHive();
|
await _cachingManager.closeHive();
|
||||||
_goToLogin(arguments: LoginArguments(LoginFormType.credentialForm));
|
_goToLogin(arguments: LoginArguments(LoginFormType.credentialForm));
|
||||||
}
|
}
|
||||||
@@ -192,7 +195,9 @@ abstract class ReloadableController extends BaseController {
|
|||||||
]);
|
]);
|
||||||
_authorizationIsolateInterceptors.clear();
|
_authorizationIsolateInterceptors.clear();
|
||||||
_authorizationInterceptors.clear();
|
_authorizationInterceptors.clear();
|
||||||
_fcmReceiver.deleteFcmToken();
|
if (_isFcmEnabled) {
|
||||||
|
_fcmReceiver.deleteFcmToken();
|
||||||
|
}
|
||||||
await _cachingManager.closeHive();
|
await _cachingManager.closeHive();
|
||||||
_goToLogin(arguments: LoginArguments(LoginFormType.ssoForm));
|
_goToLogin(arguments: LoginArguments(LoginFormType.ssoForm));
|
||||||
}
|
}
|
||||||
@@ -259,8 +264,8 @@ abstract class ReloadableController extends BaseController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void logout(Session? session, AccountId? accountId) {
|
void logout(Session? session, AccountId? accountId) {
|
||||||
final _fcmEnabled = fcmEnabled(session, accountId);
|
_isFcmEnabled = fcmEnabled(session, accountId);
|
||||||
if (_fcmEnabled) {
|
if (_isFcmEnabled) {
|
||||||
final authenticationType = _authorizationInterceptors.authenticationType;
|
final authenticationType = _authorizationInterceptors.authenticationType;
|
||||||
if (authenticationType == AuthenticationType.oidc) {
|
if (authenticationType == AuthenticationType.oidc) {
|
||||||
consumeState(_logoutOidcInteractor.execute());
|
consumeState(_logoutOidcInteractor.execute());
|
||||||
|
|||||||
Reference in New Issue
Block a user