diff options
author | S7evinK <tfaelligen@gmail.com> | 2021-12-03 18:18:35 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-12-03 17:18:35 +0000 |
commit | 08a0278760b6d64ccacdb9ab47cd468f80243c57 (patch) | |
tree | 1ba1dc2606f38892a7c995484bbea85560a094e4 /clientapi/auth | |
parent | f9bac2f78aaed91a77cc1fe455a05899be2e2a12 (diff) |
Add missing HTTP mode for userapi (#1982)
* Add missing internal api endpoint
Signed-off-by: Till Faelligen <tfaelligen@gmail.com>
* Add missing performKeyBackup endpoint
* Add missing http mode for userapi
* Fix failing tests
* Add error checks
* Fix sytest
* Update startup logic for HTTP mode
* Use userImpl for AS (annoying)
* Don't send device list updates for appservice devices
* Fix build
Co-authored-by: Neil Alexander <neilalexander@users.noreply.github.com>
Diffstat (limited to 'clientapi/auth')
-rw-r--r-- | clientapi/auth/auth.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/clientapi/auth/auth.go b/clientapi/auth/auth.go index b4c39ae3..c850bf91 100644 --- a/clientapi/auth/auth.go +++ b/clientapi/auth/auth.go @@ -70,11 +70,11 @@ func VerifyUserFromRequest( jsonErr := jsonerror.InternalServerError() return nil, &jsonErr } - if res.Err != nil { - if forbidden, ok := res.Err.(*api.ErrorForbidden); ok { + if res.Err != "" { + if strings.HasPrefix(strings.ToLower(res.Err), "forbidden:") { // TODO: use actual error and no string comparison return nil, &util.JSONResponse{ Code: http.StatusForbidden, - JSON: jsonerror.Forbidden(forbidden.Message), + JSON: jsonerror.Forbidden(res.Err), } } } |