aboutsummaryrefslogtreecommitdiff
path: root/clientapi/routing/password.go
diff options
context:
space:
mode:
authordevonh <devon.dmytro@gmail.com>2023-05-09 22:46:49 +0000
committerGitHub <noreply@github.com>2023-05-09 22:46:49 +0000
commit0489d16f95a3d9f1f5bc532e2060bd2482d7b156 (patch)
treea0573b5a0c21ca563e97abae81e36d66ad14e7d8 /clientapi/routing/password.go
parenta49c9f01e227aeb12aa2f27d5bf1915453c23a3b (diff)
Move json errors over to gmsl (#3080)
Diffstat (limited to 'clientapi/routing/password.go')
-rw-r--r--clientapi/routing/password.go12
1 files changed, 6 insertions, 6 deletions
diff --git a/clientapi/routing/password.go b/clientapi/routing/password.go
index f7f9da62..68466a77 100644
--- a/clientapi/routing/password.go
+++ b/clientapi/routing/password.go
@@ -6,11 +6,11 @@ import (
"github.com/matrix-org/dendrite/clientapi/auth"
"github.com/matrix-org/dendrite/clientapi/auth/authtypes"
"github.com/matrix-org/dendrite/clientapi/httputil"
- "github.com/matrix-org/dendrite/clientapi/jsonerror"
"github.com/matrix-org/dendrite/internal"
"github.com/matrix-org/dendrite/setup/config"
"github.com/matrix-org/dendrite/userapi/api"
"github.com/matrix-org/gomatrixserverlib"
+ "github.com/matrix-org/gomatrixserverlib/spec"
"github.com/matrix-org/util"
"github.com/sirupsen/logrus"
)
@@ -90,7 +90,7 @@ func Password(
localpart, domain, err := gomatrixserverlib.SplitID('@', device.UserID)
if err != nil {
util.GetLogger(req.Context()).WithError(err).Error("gomatrixserverlib.SplitID failed")
- return jsonerror.InternalServerError()
+ return spec.InternalServerError()
}
// Ask the user API to perform the password change.
@@ -102,11 +102,11 @@ func Password(
passwordRes := &api.PerformPasswordUpdateResponse{}
if err := userAPI.PerformPasswordUpdate(req.Context(), passwordReq, passwordRes); err != nil {
util.GetLogger(req.Context()).WithError(err).Error("PerformPasswordUpdate failed")
- return jsonerror.InternalServerError()
+ return spec.InternalServerError()
}
if !passwordRes.PasswordUpdated {
util.GetLogger(req.Context()).Error("Expected password to have been updated but wasn't")
- return jsonerror.InternalServerError()
+ return spec.InternalServerError()
}
// If the request asks us to log out all other devices then
@@ -120,7 +120,7 @@ func Password(
logoutRes := &api.PerformDeviceDeletionResponse{}
if err := userAPI.PerformDeviceDeletion(req.Context(), logoutReq, logoutRes); err != nil {
util.GetLogger(req.Context()).WithError(err).Error("PerformDeviceDeletion failed")
- return jsonerror.InternalServerError()
+ return spec.InternalServerError()
}
pushersReq := &api.PerformPusherDeletionRequest{
@@ -130,7 +130,7 @@ func Password(
}
if err := userAPI.PerformPusherDeletion(req.Context(), pushersReq, &struct{}{}); err != nil {
util.GetLogger(req.Context()).WithError(err).Error("PerformPusherDeletion failed")
- return jsonerror.InternalServerError()
+ return spec.InternalServerError()
}
}