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
}
_ = authUser
// open imap client
client, err := recv.MakeClient(authUser.Subject)
if err != nil {
_ = c.WriteJSON(map[string]string{"error": "Making client failed"})
return
}
// auth was ok
err = c.WriteJSON(map[string]string{"auth": "ok"})
if err != nil {
return
}
for {
// authenticated users get longer to reply
// a simple ping/pong setup bypasses this