Closed nachoperez714 closed 2 years ago
Hi @nachoperez714,
This is probably due to the fact that getUser()
is returning an optional value, and the secret:
parameter only takes non-optional arguments.
Try something like this:
// Unwrap the optional value first
if let user = getUser() {
totp = TOTP(secret: user, digits: 6, timeInterval: 30, algorithm: .sha1)
}
I just try this
TOTP(secret: getUser()?.secret, digits: 6, timeInterval: 30, algorithm: .sha1)
And swift hits me with
Type of expression is ambiguous without more context
Am i missing something? I was following the readme