Skip to content

Commit c9133b2

Browse files
committed
don't close the auth channel so fast
1 parent 68d1244 commit c9133b2

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

config/auth.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,10 @@ func (a *Authenticator) handler(w http.ResponseWriter, r *http.Request) {
5656
key := r.URL.Query().Get("key")
5757
projectID := r.URL.Query().Get("project")
5858
slog.Debug("API key received", "APIKey", key, "ProjectID", projectID)
59-
a.authCh <- authContext{APIKey: key, ProjectID: projectID}
59+
go func() {
60+
time.Sleep(2 * time.Second)
61+
a.authCh <- authContext{APIKey: key, ProjectID: projectID}
62+
}()
6063
fmt.Fprintf(w, web.LoginOKHTML)
6164
}
6265

0 commit comments

Comments
 (0)