mirror of
https://github.com/safing/portbase
synced 2025-09-02 02:29:59 +00:00
Update rng package import
This commit is contained in:
parent
d0ffecb060
commit
f7ccc58b98
1 changed files with 2 additions and 2 deletions
|
@ -6,8 +6,8 @@ import (
|
||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/safing/portbase/crypto/random"
|
|
||||||
"github.com/safing/portbase/log"
|
"github.com/safing/portbase/log"
|
||||||
|
"github.com/safing/portbase/rng"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
@ -91,7 +91,7 @@ func authMiddleware(next http.Handler) http.Handler {
|
||||||
}
|
}
|
||||||
|
|
||||||
// write new cookie
|
// write new cookie
|
||||||
token, err := random.Bytes(32) // 256 bit
|
token, err := rng.Bytes(32) // 256 bit
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Warningf("api: failed to generate random token: %s", err)
|
log.Warningf("api: failed to generate random token: %s", err)
|
||||||
http.Error(w, "Internal Server Error", http.StatusInternalServerError)
|
http.Error(w, "Internal Server Error", http.StatusInternalServerError)
|
||||||
|
|
Loading…
Add table
Reference in a new issue