Skip to content

Commit

Permalink
Merge pull request #425 from auth0/rf-canceled-auth
Browse files Browse the repository at this point in the history
Deprecate isAuthenticationCanceled in favor of isCanceled
  • Loading branch information
lbalmaceda authored Jan 11, 2021
2 parents deee9bf + 9aaaea5 commit 1b3c05e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
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

0 comments on commit 1b3c05e

Please sign in to comment.