Fix reconnect on remote logout issues

This commit is contained in:
Max Sandholm 2023-01-05 16:28:15 +02:00
parent 7a0091bff2
commit ee5cf7fe11
2 changed files with 2 additions and 2 deletions

View file

@ -52,7 +52,7 @@ func (user *User) GetRemoteID() string {
if user == nil || user.JID.IsEmpty() {
return ""
}
return fmt.Sprintf("%s_a%d_d%d", user.JID.User, user.JID.Agent, user.JID.Device)
return user.JID.User
}
func (user *User) GetRemoteName() string {

View file

@ -543,7 +543,7 @@ func jsonResponse(w http.ResponseWriter, status int, response interface{}) {
func (prov *ProvisioningAPI) Logout(w http.ResponseWriter, r *http.Request) {
user := r.Context().Value("user").(*User)
if user.Session == nil {
jsonResponse(w, http.StatusNotFound, Error{
jsonResponse(w, http.StatusOK, Error{
Error: "You're not logged in",
ErrCode: "not logged in",
})