Add description field to OtpType

This commit is contained in:
Danny Moesch 2018-12-02 17:49:16 +01:00 committed by Bob Sun
parent 469451b7b7
commit cfb50276bc
4 changed files with 43 additions and 14 deletions

View file

@ -8,9 +8,15 @@
import OneTimePassword
public enum OtpType {
case totp, hotp, none
public enum OtpType: String {
case totp = "time-based"
case hotp = "HMAC-based"
case none
var description: String {
return rawValue
}
init(token: Token?) {
switch token?.generator.factor {
case .some(.counter):