Skip to content

Commit

Permalink
Update TOTP module err handling
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisfisher committed Sep 22, 2024
1 parent 97c6a78 commit a44e105
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions ios/AuthsignalTOTPModule.swift
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ class AuthsignalTOTPModule: NSObject {
Task.init {
let response = await authsignal!.enroll()

if (response.errorCode == "token_not_set") {
reject("tokenNotSetError", "token_not_set", nil)
if (response.errorCode != nil) {
reject("enrollError", response.errorCode, nil)
} else if (response.error != nil) {
reject("enrollError", response.error, nil)
} else {
Expand Down Expand Up @@ -64,8 +64,8 @@ class AuthsignalTOTPModule: NSObject {
Task.init {
let response = await authsignal!.verify(code: codeStr)

if (response.errorCode == "token_not_set") {
reject("tokenNotSetError", "token_not_set", nil)
if (response.errorCode != nil) {
reject("verifyError", response.errorCode, nil)
} else if (response.error != nil) {
reject("verifyError", response.error, nil)
} else {
Expand Down

0 comments on commit a44e105

Please sign in to comment.