mirror of
https://github.com/getAlby/lndhub.go.git
synced 2026-01-07 15:05:37 +01:00
Minor fixes
This commit is contained in:
@@ -18,7 +18,7 @@ import (
|
||||
|
||||
type jwtCustomClaims struct {
|
||||
ID int64 `json:"id"`
|
||||
IsRefresh bool `json:isRefresh`
|
||||
IsRefresh bool `json:"isRefresh"`
|
||||
jwt.StandardClaims
|
||||
}
|
||||
|
||||
@@ -72,9 +72,9 @@ func UserMiddleware(db *bun.DB) echo.MiddlewareFunc {
|
||||
// GenerateAccessToken : Generate Access Token
|
||||
func GenerateAccessToken(secret []byte, u *models.User) (string, error) {
|
||||
claims := &jwtCustomClaims{
|
||||
u.ID,
|
||||
false,
|
||||
jwt.StandardClaims{
|
||||
ID: u.ID,
|
||||
IsRefresh: false,
|
||||
StandardClaims: jwt.StandardClaims{
|
||||
// one week expiration
|
||||
ExpiresAt: time.Now().Add(time.Hour * 24 * 7).Unix(),
|
||||
},
|
||||
@@ -93,9 +93,9 @@ func GenerateAccessToken(secret []byte, u *models.User) (string, error) {
|
||||
// GenerateRefreshToken : Generate Refresh Token
|
||||
func GenerateRefreshToken(secret []byte, u *models.User) (string, error) {
|
||||
claims := &jwtCustomClaims{
|
||||
u.ID,
|
||||
true,
|
||||
jwt.StandardClaims{
|
||||
ID: u.ID,
|
||||
IsRefresh: true,
|
||||
StandardClaims: jwt.StandardClaims{
|
||||
// one week expiration
|
||||
ExpiresAt: time.Now().Add(time.Hour * 24 * 7).Unix(),
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user