update to new core session system
This commit is contained in:
parent
f5ab92b1cf
commit
df80e29f6e
5 changed files with 8 additions and 188 deletions
|
|
@ -6,8 +6,6 @@
|
|||
package utils
|
||||
|
||||
import (
|
||||
"crypto/md5"
|
||||
"fmt"
|
||||
"log"
|
||||
"time"
|
||||
|
||||
|
|
@ -71,13 +69,7 @@ func CreateSeedData() {
|
|||
}
|
||||
}
|
||||
|
||||
// generate a hashed string to be used as key for caching auth jwt token
|
||||
func CreateAuthTokenHashedCacheKey(userID uint, userAgent string) string {
|
||||
cacheKey := fmt.Sprintf("userid:_%v_useragent:_%v_jwt_token", userID, userAgent)
|
||||
hashedCacheKey := fmt.Sprintf("%v", fmt.Sprintf("%x", md5.Sum([]byte(cacheKey))))
|
||||
|
||||
return hashedCacheKey
|
||||
}
|
||||
|
||||
func FormatUnix(value int64) string {
|
||||
return time.Unix(value, 0).Format("2006-01-02 15:04:05")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue