chore(auth): finalize test of new structure
This commit is contained in:
@@ -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" {
|
||||
|
||||
Reference in New Issue
Block a user