mirror of
https://github.com/element-hq/dendrite.git
synced 2025-09-13 12:52:24 +03:00
Move MakeJoin logic to GMSL (#3081)
This commit is contained in:
parent
0489d16f95
commit
67d6876857
80 changed files with 1158 additions and 494 deletions
|
@ -26,6 +26,7 @@ import (
|
|||
|
||||
"github.com/matrix-org/dendrite/setup/config"
|
||||
"github.com/matrix-org/gomatrixserverlib/fclient"
|
||||
"github.com/matrix-org/gomatrixserverlib/spec"
|
||||
)
|
||||
|
||||
// EmailAssociationRequest represents the request defined at https://matrix.org/docs/spec/client_server/r0.2.0.html#post-matrix-client-r0-register-email-requesttoken
|
||||
|
@ -133,7 +134,7 @@ func CheckAssociation(
|
|||
return false, "", "", err
|
||||
}
|
||||
|
||||
if respBody.ErrCode == "M_SESSION_NOT_VALIDATED" {
|
||||
if respBody.ErrCode == string(spec.ErrorSessionNotValidated) {
|
||||
return false, "", "", nil
|
||||
} else if len(respBody.ErrCode) > 0 {
|
||||
return false, "", "", errors.New(respBody.Error)
|
||||
|
@ -186,5 +187,5 @@ func isTrusted(idServer string, cfg *config.ClientAPI) error {
|
|||
return nil
|
||||
}
|
||||
}
|
||||
return ErrNotTrusted
|
||||
return ErrNotTrusted{}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue