diff options
author | Brian Picciano <mediocregopher@gmail.com> | 2022-05-19 22:44:33 -0600 |
---|---|---|
committer | Brian Picciano <mediocregopher@gmail.com> | 2022-05-19 22:44:33 -0600 |
commit | 3664286506f673737c0784b9cfd494cda1dc4618 (patch) | |
tree | aa30b37e0d9057bf945eec0d3699404e08445b8b /srv/src/cmd/hash-password | |
parent | 8da42184eb26bbd35618d81e47bcd23b6ce21adb (diff) |
Actually use the auth middleware for assets routes
Diffstat (limited to 'srv/src/cmd/hash-password')
-rw-r--r-- | srv/src/cmd/hash-password/main.go | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/srv/src/cmd/hash-password/main.go b/srv/src/cmd/hash-password/main.go new file mode 100644 index 0000000..b787a4d --- /dev/null +++ b/srv/src/cmd/hash-password/main.go @@ -0,0 +1,23 @@ +package main + +import ( + "bufio" + "fmt" + "os" + "strings" + + "github.com/mediocregopher/blog.mediocregopher.com/srv/api" +) + +func main() { + + fmt.Fprint(os.Stderr, "Password: ") + + line, err := bufio.NewReader(os.Stdin).ReadString('\n') + + if err != nil { + panic(err) + } + + fmt.Println(api.NewPasswordHash(strings.TrimSpace(line))) +} |