some updates
This commit is contained in:
parent
9f4fda3c8b
commit
f5c47ea28a
43 changed files with 80 additions and 356 deletions
|
|
@ -15,10 +15,7 @@ func (db *DB) Remove(sig string) error {
|
|||
}
|
||||
|
||||
func (db *DB) Check(sig string) (ok bool) {
|
||||
if db.store.Get(blacklistPrefix+sig, nil) == nil {
|
||||
return true
|
||||
}
|
||||
return false
|
||||
return db.store.Get(blacklistPrefix+sig, nil) == nil
|
||||
}
|
||||
|
||||
func (db *DB) Map() (list jwt.BlacklistMap, err error) {
|
||||
|
|
|
|||
|
|
@ -66,10 +66,7 @@ func (db *DB) CreateUser(username, password string) error {
|
|||
|
||||
func (db *DB) BasicAuth(username, password string) bool {
|
||||
_, err := db.Login(username, password)
|
||||
if err == nil {
|
||||
return true
|
||||
}
|
||||
return false
|
||||
return err == nil
|
||||
}
|
||||
|
||||
func (db *DB) Login(username, password string) (u core.User, err error) {
|
||||
|
|
|
|||
|
|
@ -216,7 +216,7 @@ func (c *Context) GetForm(name string) string {
|
|||
}
|
||||
|
||||
func (c *Context) Var(name string) (ret string) {
|
||||
ret, _ = mux.Vars(c.Request)[name]
|
||||
ret = mux.Vars(c.Request)[name]
|
||||
return
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,6 @@ package store
|
|||
import (
|
||||
"bytes"
|
||||
"errors"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"testing"
|
||||
|
|
@ -20,7 +19,7 @@ func TestBoltStore(t *testing.T) {
|
|||
{"123"},
|
||||
{"hello"},
|
||||
}
|
||||
dir, err := ioutil.TempDir("", "")
|
||||
dir, err := os.MkdirTemp("", "")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue