summaryrefslogtreecommitdiff
path: root/system/db/user.go
diff options
context:
space:
mode:
authorSteve Manuel <nilslice@gmail.com>2017-01-02 21:57:53 -0800
committerSteve Manuel <nilslice@gmail.com>2017-01-02 21:57:53 -0800
commitc1d9ac15acdc9ea2f389cfcd8eee2ac7db291f87 (patch)
tree316c4a0c854dca1a089573daf44cc0098a643ed2 /system/db/user.go
parent2ed96b15af39aaeb43ed56c7c9ef6535f31a6d96 (diff)
update codebase where previous deps were used
Diffstat (limited to 'system/db/user.go')
-rw-r--r--system/db/user.go6
1 files changed, 4 insertions, 2 deletions
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"))