From c1d9ac15acdc9ea2f389cfcd8eee2ac7db291f87 Mon Sep 17 00:00:00 2001 From: Steve Manuel Date: Mon, 2 Jan 2017 21:57:53 -0800 Subject: update codebase where previous deps were used --- system/db/user.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'system/db') diff --git a/system/db/user.go b/system/db/user.go index 1b15a82..02fda95 100644 --- a/system/db/user.go +++ b/system/db/user.go @@ -5,13 +5,14 @@ import ( "encoding/json" "errors" "fmt" + "math/rand" "net/http" + "time" "github.com/ponzu-cms/ponzu/system/admin/user" "github.com/boltdb/bolt" "github.com/nilslice/jwt" - "github.com/nilslice/rand" ) // ErrUserExists is used for the db to report to admin user of existing user @@ -198,7 +199,8 @@ func CurrentUser(req *http.Request) ([]byte, error) { // SetRecoveryKey generates and saves a random secret key to verify an email // address submitted in order to recover/reset an account password func SetRecoveryKey(email string) (string, error) { - key := fmt.Sprintf("%d", rand.Int63()) + r := rand.New(rand.NewSource(time.Now().Unix())) + key := fmt.Sprintf("%d", r.Int63()) err := store.Update(func(tx *bolt.Tx) error { b, err := tx.CreateBucketIfNotExists([]byte("__recoveryKeys")) -- cgit v1.2.3