diff --git a/auth/auth.go b/auth/auth.go index 2760665..04c5222 100644 --- a/auth/auth.go +++ b/auth/auth.go @@ -13,6 +13,7 @@ import ( ) type AuthStore interface { + Get(user string) bool Register(user, pass string) error Login(user, pass string) (token string, err error) Verify(token string) (session Session, err error) @@ -39,6 +40,11 @@ func New(path string, hashKey []byte) (AuthStore, error) { return s, err } +func (s Htpasswd) Get(user string) bool { + _, ok := s.accounts[user] + return ok +} + func (s Htpasswd) Register(user, pass string) (err error) { if _, ok := s.accounts[user]; ok { return errors.New("user already exists") diff --git a/templates/signin.html b/templates/signin.html index e9ff082..72b6af0 100644 --- a/templates/signin.html +++ b/templates/signin.html @@ -1,10 +1,11 @@ -{{ define "title" }}Sign Up{{ end }} +{{ define "title" }}登入{{ end }} {{ define "main" }} -