2023-09-12 02:26:46 +03:00
|
|
|
//go:build darwin
|
2023-09-12 02:22:48 +03:00
|
|
|
|
|
|
|
package biometrics
|
|
|
|
|
2023-09-12 03:54:46 +03:00
|
|
|
import (
|
|
|
|
touchid "github.com/lox/go-touchid"
|
|
|
|
)
|
|
|
|
|
2023-09-12 02:22:48 +03:00
|
|
|
func CheckBiometrics(approvalType Approval) bool {
|
2023-09-12 02:26:16 +03:00
|
|
|
ok, err := touchid.Authenticate(approvalType.String())
|
2023-09-12 02:22:48 +03:00
|
|
|
if err != nil {
|
2023-09-12 04:26:05 +03:00
|
|
|
log.Error(err.Error())
|
2023-09-12 02:22:48 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
if ok {
|
2023-09-12 03:54:46 +03:00
|
|
|
log.Info("Authenticated")
|
2023-09-12 02:22:48 +03:00
|
|
|
return true
|
|
|
|
} else {
|
2023-09-12 03:54:46 +03:00
|
|
|
log.Error("Failed to authenticate")
|
2023-09-12 02:22:48 +03:00
|
|
|
return false
|
|
|
|
}
|
|
|
|
}
|
2023-09-19 23:32:15 +03:00
|
|
|
|
|
|
|
func BiometricsWorking() bool {
|
|
|
|
return false
|
|
|
|
}
|