Refactor everything

This commit is contained in:
Andrew-71 2024-10-12 21:45:00 +03:00
parent b07f1b080a
commit cda8f0cc1b
11 changed files with 162 additions and 59 deletions

17
cmd/verify/main.go Normal file
View file

@ -0,0 +1,17 @@
package verify
import (
"log/slog"
"os"
"git.a71.su/Andrew71/pye/auth"
)
func Verify(token, filename string) {
key, err := os.ReadFile(filename)
if err != nil {
slog.Error("error reading file", "error", err, "file", filename)
}
t, err := auth.VerifyJWT(token, key)
slog.Info("result", "token", t, "error", err, "ok", err == nil)
}