Refactor everything
This commit is contained in:
parent
b07f1b080a
commit
cda8f0cc1b
11 changed files with 162 additions and 59 deletions
17
cmd/verify/main.go
Normal file
17
cmd/verify/main.go
Normal 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)
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue