Download file

This commit is contained in:
Aurélie Delhaie
2022-05-22 21:55:55 +02:00
parent c23838b14c
commit e3c2068ae9
4 changed files with 57 additions and 3 deletions

View File

@@ -7,7 +7,6 @@ import (
"golang.org/x/crypto/bcrypt"
"log"
"opensavecloudserver/database"
"time"
)
var secret []byte
@@ -78,7 +77,6 @@ func Register(user *Registration) error {
func token(userId int) (string, error) {
token := jwt.NewWithClaims(jwt.SigningMethodHS512, jwt.MapClaims{
"sub": userId,
"exp": time.Now().Add(1 * time.Hour).Unix(),
})
return token.SignedString(secret)
}