WIP: Update to the go api.

This commit is contained in:
Jesse Malotaux 2025-03-24 20:22:31 +01:00
parent 03181cf6a4
commit 3b38372b4b
16 changed files with 317 additions and 30 deletions

View file

@ -0,0 +1,27 @@
package helper
import (
"log"
"os"
"time"
)
func TempPinFile(Uuid string, pin string) bool {
log.Println("temp pin file", Uuid, pin)
err := os.WriteFile("devices/"+Uuid+".tmp", []byte(pin), 0644)
if err != nil {
log.Println(err)
return false
}
time.AfterFunc(1*time.Minute, func() {
log.Println("deleting", Uuid, pin)
os.Remove("devices/" + Uuid + ".tmp")
})
return true
}
func CheckPinFile(encryptedData []byte) bool {
return false
}