Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecate isAuthenticationCanceled in favor of isCanceled #425

Merged
merged 1 commit into from
Jan 11, 2021
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 @@ -143,7 +143,11 @@ public class AuthenticationException : Auth0Exception {
get() = "a0.invalid_configuration" == code

// When a user closes the browser app and in turn, cancels the authentication
@Deprecated("This property can refer to both log in and log out actions.", replaceWith = ReplaceWith("isCanceled"))
public val isAuthenticationCanceled: Boolean
get() = isCanceled

public val isCanceled: Boolean
get() = "a0.authentication_canceled" == code

/// When MFA code is required to authenticate
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -408,6 +408,15 @@ public class AuthenticationExceptionTest {
MatcherAssert.assertThat(ex.isAuthenticationCanceled, CoreMatchers.`is`(true))
}

@Test
public fun shouldHaveCanceled() {
values[CODE_KEY] = "a0.authentication_canceled"
val ex = AuthenticationException(
values
)
MatcherAssert.assertThat(ex.isCanceled, CoreMatchers.`is`(true))
}

@Test
public fun shouldHavePasswordLeaked() {
values[CODE_KEY] = "password_leaked"
Expand Down