Skip to content

Commit

Permalink
Unit test OTP proof confirmation
Browse files Browse the repository at this point in the history
  • Loading branch information
UnknownJoe796 committed Oct 10, 2023
1 parent ebb239f commit 6bd06f8
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,10 @@ class AuthEndpointsForSubjectTest {
TestSettings.proofOtp.establish.implementation(AuthAndPathParts(auth as RequestAuth<HasId<*>>, null, arrayOf()), EstablishOtp("Test Label"))
@Suppress("UNCHECKED_CAST") var secret = TestSettings.proofOtp.table(TestSettings.subjectHandler).get(self._id as Comparable<Any>)!!
assertFalse(secret.active)
run {
// Can still log in with email pin only before confirmation
assertNotNull(TestSettings.testUserSubject.login.implementation(AuthAndPathParts(null, null, arrayOf()), listOf(proof1)).session)
}
TestSettings.proofOtp.confirm.implementation(AuthAndPathParts(auth as RequestAuth<HasId<*>>, null, arrayOf()), secret.generator.generate())
secret = TestSettings.proofOtp.table(TestSettings.subjectHandler).get(self._id as Comparable<Any>)!!
assertTrue(secret.active)
Expand Down

0 comments on commit 6bd06f8

Please sign in to comment.