Respond incase of ok auth

This commit is contained in:
Melon 2023-09-11 17:46:53 +01:00
parent 675423c06e
commit 2918a32c1c
Signed by: melon
GPG Key ID: 6C9D970C50D26A25

View File

@ -74,14 +74,19 @@ func SetupApiServer(listen string, auth *AuthChecker, send Smtp, recv Imap) *htt
return return
} }
_ = authUser // open imap client
client, err := recv.MakeClient(authUser.Subject) client, err := recv.MakeClient(authUser.Subject)
if err != nil { if err != nil {
_ = c.WriteJSON(map[string]string{"error": "Making client failed"}) _ = c.WriteJSON(map[string]string{"error": "Making client failed"})
return return
} }
// auth was ok
err = c.WriteJSON(map[string]string{"auth": "ok"})
if err != nil {
return
}
for { for {
// authenticated users get longer to reply // authenticated users get longer to reply
// a simple ping/pong setup bypasses this // a simple ping/pong setup bypasses this