hot+fix: round expires in number

This commit is contained in:
2025-06-16 19:01:28 +02:00
parent b3ad13e55d
commit 72083fa0a4

View File

@ -5,6 +5,7 @@ import (
"encoding/json"
"fmt"
"log"
"math"
"net/http"
"strings"
"time"
@ -236,7 +237,7 @@ func (h *OAuthHandler) tokenEndpoint(w http.ResponseWriter, r *http.Request) {
TokenType: "Bearer",
AccessToken: access.Token,
RefreshToken: refresh.Token,
ExpiresIn: access.ExpiresAt.Sub(time.Now()).Seconds(),
ExpiresIn: math.Ceil(access.ExpiresAt.Sub(time.Now()).Seconds()),
Email: user.Email,
}
@ -328,7 +329,7 @@ func (h *OAuthHandler) tokenEndpoint(w http.ResponseWriter, r *http.Request) {
TokenType: "Bearer",
AccessToken: access.Token,
RefreshToken: refresh.Token,
ExpiresIn: access.ExpiresAt.Sub(time.Now()).Seconds(),
ExpiresIn: math.Ceil(access.ExpiresAt.Sub(time.Now()).Seconds()),
}
log.Printf("DEBUG: refresh - sending following response: %#v\n", response)