mirror of
https://github.com/1f349/lotus.git
synced 2024-12-23 00:24:17 +00:00
Respond incase of ok auth
This commit is contained in:
parent
675423c06e
commit
2918a32c1c
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user