Skip to content

Commit 3c8adfc

Browse files
committed
Fix subsequent sign outs not publishing a hub event
1 parent 93df7d5 commit 3c8adfc

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

aws-auth-cognito/src/main/java/com/amplifyframework/auth/cognito/RealAWSCognitoAuthPlugin.kt

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,6 @@ import com.amplifyframework.statemachine.codegen.states.HostedUISignInState
8383
import com.amplifyframework.statemachine.codegen.states.SignOutState
8484
import java.util.concurrent.CountDownLatch
8585
import java.util.concurrent.TimeUnit
86-
import java.util.concurrent.atomic.AtomicReference
8786
import kotlinx.coroutines.flow.collect
8887
import kotlinx.coroutines.flow.takeWhile
8988

@@ -94,9 +93,6 @@ internal class RealAWSCognitoAuthPlugin(
9493
private val authStateMachine: AuthStateMachine,
9594
private val logger: Logger
9695
) {
97-
98-
private val lastPublishedHubEventName = AtomicReference<String>()
99-
10096
init {
10197
addAuthStateChangeListener()
10298
configureAuthStates()
@@ -777,9 +773,6 @@ internal class RealAWSCognitoAuthPlugin(
777773
}
778774

779775
private fun sendHubEvent(eventName: String) {
780-
if (lastPublishedHubEventName.get() != eventName) {
781-
lastPublishedHubEventName.set(eventName)
782-
Amplify.Hub.publish(HubChannel.AUTH, HubEvent.create(eventName))
783-
}
776+
Amplify.Hub.publish(HubChannel.AUTH, HubEvent.create(eventName))
784777
}
785778
}

0 commit comments

Comments
 (0)