Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Initial implementation: SetDisplayName -> SetMxIdDialog #849

Merged
merged 7 commits into from
May 2, 2017

Conversation

lukebarnard1
Copy link
Contributor

@lukebarnard1 lukebarnard1 commented Apr 28, 2017

  • Replaces SetDisplayNameDialog with SetMxIdDialog. This new dialog will use InteractiveAuth to authenticate a user with their chosen mxid.

De-scoped:

  • style tweaks for the InteractiveAuth in the dialog (capcha) and error message.
  • checking for mxid availability
    2017-04-28-132742_783x567_scrot

For now, based on element-hq/element-web#3604 (comment)

- Replaces SetDisplayNameDialog with SetMxIdDialog. This new dialog will use InteractiveAuth to authenticate a user with their chosen mxid.

De-scoped:
 - style tweaks for the InteractiveAuth in the dialog (capcha) and error message.
 - checking for mxid availability
@@ -0,0 +1,153 @@
/*
Copyright 2016 OpenMarket Ltd
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

copyright

},

_generateAndCachePassword: function() {
const pass = Math.random().toString(36).slice(2);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm, I guess so!


return this._matrixClient.register(
this.state.username,
this._generateAndCachePassword(),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So here you're setting the password before the account is registered (and overwriting it with a new one for each time we try to register). It feels like it really ought to be set along with the access token.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, agreed

@dbkr
Copy link
Member

dbkr commented Apr 28, 2017

Oh also you seem to have met our new friend, undefined is not a function.

Luke Barnard added 3 commits May 2, 2017 09:56
So that we don't overwrite the existing one every time we try to register.
@lukebarnard1
Copy link
Contributor Author

It looks like isGuest was not being mocked. I'll make it return false. Seems odd that this has never been run into, indicates that only now are the tested code paths calling isGuest.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants