Skip to content

Commit

Permalink
Fixed lint
Browse files Browse the repository at this point in the history
  • Loading branch information
joeldavidw committed Jul 25, 2024
1 parent 466e603 commit 15d1ee4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions Chronos/Services/Import/ImportService.swift
Original file line number Diff line number Diff line change
Expand Up @@ -155,23 +155,23 @@ extension ImportService {
default:
tokenAlgo = TokenAlgorithmEnum.SHA1
}

let token = Token()
token.issuer = gaToken.issuer
token.account = gaToken.name
token.digits = tokenDigits
token.type = tokenType
token.algorithm = tokenAlgo
token.secret = gaToken.secret.base32EncodedString

if tokenType == .TOTP {
token.period = 30 // GA only allows 30 secs
}

if tokenType == .HOTP {
token.counter = Int(gaToken.counter)
}

tokens.append(token)
}

Expand Down
6 changes: 3 additions & 3 deletions ChronosTests/Import/GoogleAuthenticator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ final class GoogleAuthenticatorTests: XCTestCase {
XCTAssertEqual(tokens[0].account, "[email protected]")
XCTAssertEqual(tokens[0].period, 30)
XCTAssertEqual(tokens[0].secret, "JBSWY3DPEHPK3PXP")

XCTAssertEqual(tokens[1].digits, 8)
XCTAssertEqual(tokens[1].type, TokenTypeEnum.TOTP)
XCTAssertEqual(tokens[1].counter, 0)
Expand All @@ -28,7 +28,7 @@ final class GoogleAuthenticatorTests: XCTestCase {
XCTAssertEqual(tokens[1].account, "[email protected]")
XCTAssertEqual(tokens[1].period, 30)
XCTAssertEqual(tokens[1].secret, "JBSWY3DPEHPK3PXP")

XCTAssertEqual(tokens[2].digits, 6)
XCTAssertEqual(tokens[2].type, TokenTypeEnum.HOTP)
XCTAssertEqual(tokens[2].counter, 0)
Expand All @@ -37,7 +37,7 @@ final class GoogleAuthenticatorTests: XCTestCase {
XCTAssertEqual(tokens[2].account, "[email protected]")
XCTAssertEqual(tokens[2].counter, 0)
XCTAssertEqual(tokens[2].secret, "JBSWY3DPEHPK3PXP")

XCTAssertEqual(tokens[3].digits, 8)
XCTAssertEqual(tokens[3].type, TokenTypeEnum.HOTP)
XCTAssertEqual(tokens[3].counter, 0)
Expand Down

0 comments on commit 15d1ee4

Please sign in to comment.