Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -582,7 +582,6 @@ internal class AuthenticatorViewModel(
logger.error(result.error.toString())
logger.error("Current signed in user session has expired, signing out.")
signOut()
moveTo(AuthenticatorStep.SignIn)
} else {
handleGeneralFailure(result.error)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ class AuthenticatorViewModelTest {
}

@Test
fun `getCurrentUser error with session expired exception during start results in SignIn state`() = runTest {
fun `getCurrentUser error with session expired exception during start results in being signed out`() = runTest {
coEvery { authProvider.fetchAuthSession() } returns Success(mockAuthSession(isSignedIn = true))
coEvery { authProvider.getCurrentUser() } returns AmplifyResult.Error(SessionExpiredException())

Expand All @@ -143,8 +143,8 @@ class AuthenticatorViewModelTest {
coVerify(exactly = 1) {
authProvider.fetchAuthSession()
authProvider.getCurrentUser()
authProvider.signOut()
}
viewModel.currentStep shouldBe AuthenticatorStep.SignIn
}

@Test
Expand Down