sessions #2

Merged
admin merged 63 commits from sessions into main 2025-06-16 19:03:01 +02:00
53 changed files with 2623 additions and 190 deletions
Showing only changes of commit 72083fa0a4 - Show all commits

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)