chore(auth): finalize test of new structure
All checks were successful
Build Docker Image / Explore-Gitea-Actions (push) Successful in 45s

This commit is contained in:
2024-09-26 22:43:14 +02:00
parent bd721a1e48
commit 79418b0b23
6 changed files with 111 additions and 79 deletions

View File

@@ -90,6 +90,13 @@ func GetUserFromSession(db *sql.DB, r *http.Request) *types.User {
}
func WaitMinimumTime[T interface{}](waitTime time.Duration, function func() (T, error)) (T, error) {
start := time.Now()
result, err := function()
time.Sleep(waitTime - time.Since(start))
return result, err
}
func getSessionID(r *http.Request) string {
for _, c := range r.Cookies() {
if c.Name == "id" {