mirror of
https://github.com/getAlby/lndhub.go.git
synced 2026-01-04 13:35:25 +01:00
Merge remote-tracking branch 'getalby/main' into logging
* getalby/main: Minor fixes
This commit is contained in:
@@ -17,7 +17,7 @@ import (
|
||||
|
||||
type jwtCustomClaims struct {
|
||||
ID int64 `json:"id"`
|
||||
IsRefresh bool `json:isRefresh`
|
||||
IsRefresh bool `json:"isRefresh"`
|
||||
jwt.StandardClaims
|
||||
}
|
||||
|
||||
@@ -71,9 +71,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(),
|
||||
},
|
||||
@@ -92,9 +92,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