update m.id.user to m.id.publickey

This commit is contained in:
Tak Wai Wong 2022-04-28 10:27:10 -07:00
parent 390d557df8
commit f995735d20
2 changed files with 2 additions and 2 deletions

View file

@ -155,7 +155,7 @@ func (pk LoginPublicKeyEthereum) ValidateLoginResponse() (bool, *jsonerror.Matri
func (pk LoginPublicKeyEthereum) CreateLogin() *Login {
identifier := LoginIdentifier{
Type: "m.id.user",
Type: "m.id.publickey",
User: pk.Address,
}
login := Login{

View file

@ -74,7 +74,7 @@ type Login struct {
// Username returns the user localpart/user_id in this request, if it exists.
func (r *Login) Username() string {
if r.Identifier.Type == "m.id.user" {
if r.Identifier.Type == "m.id.user" || r.Identifier.Type == "m.id.publickey" {
return r.Identifier.User
}
// deprecated but without it Element iOS won't log in