Implement refresh token endpoint
All checks were successful
ci/woodpecker/push/build Pipeline was successful

Signed-off-by: Nikolai Rodionov <allanger@badhouseplants.net>
This commit is contained in:
2026-05-09 21:36:23 +02:00
parent 19e47876f0
commit e58eba1b16
10 changed files with 356 additions and 148 deletions

View File

@@ -77,10 +77,12 @@ func (c *AccountController) Login(ctx context.Context, email, password string) (
}
func (c *AccountController) GenerateAccessToken(userID string) (string, error) {
tokenID := uuid.New().String()
claims := jwt.MapClaims{
"user_id": userID,
"type": "access",
"exp": time.Now().Add(c.AccessTokenTTL).Unix(),
"user_id": userID,
"type": "access",
"exp": time.Now().Add(c.AccessTokenTTL).Unix(),
"token_id": tokenID,
}
token := jwt.NewWithClaims(jwt.SigningMethodHS256, claims)