Commit graph

66 commits

Author SHA1 Message Date
Luke Barnard
1e9a2e80e9 Remove empty line 2017-04-25 11:57:03 +01:00
Luke Barnard
aac0238882 Remove redundant API for getting country prefix 2017-04-25 11:25:14 +01:00
Luke Barnard
336462366e Improve country dropdown UX and expose +prefix
A prefix is now exposed through a change to the API for onOptionChange. This now returns the entire country object which includes iso2, prefix etc.

This also shows the prefix in the Registration and Login screens as a prefix to the phone number field.
2017-04-25 11:21:47 +01:00
Luke Barnard
9c4c706120 Remove :server.name for custom servers
Custom servers may not be configured such that their domain name === domain part.
2017-04-21 16:09:11 +01:00
Luke Barnard
2b9cb999ba autoFocus PasswordLogin 2017-04-21 11:50:19 +01:00
Luke Barnard
9cd7914ea5 Finishing off the first iteration on login UI
This makes the following changes:
 - Improve CountryDropdown by allowing all countries to be displayed at once and using PNGs for performance (trading of quality - the pngs are scaled down from 32px to 25px)
 - "I want to sign in with" dropdown to select login method
 - MXID login field that suffixes HS domain (whether custom or matrix.org) and prefixes "@"
 - Email field which is secretly the same as the username field but with a different placeholder
 - No more login flickering when changing ServerConfig (!) fixes https://github.com/vector-im/riot-web/issues/1517

This implements most of the design in https://github.com/vector-im/riot-web/issues/3524 but neglects the phone number login:
![login_with_msisdn](https://cloud.githubusercontent.com/assets/1922197/24864469/30a921fc-1dfc-11e7-95d1-76f619da1402.png)

This will be updated in another PR to implement desired things:
 - Country code visible once a country has been selected (propbably but as a prefix to the phone number input box.
 - Use square flags
 - Move CountryDropdown above phone input and make it show the full country name when not expanded
 - Auto-select country based on IP
2017-04-21 11:37:08 +01:00
Luke Barnard
566a315242 Initial commit on riot-web#3524 (login UI update) 2017-04-19 10:08:04 +01:00
David Baker
e139f5212a Remove React warning
Fire onOptionChange in componentWillMount, otherwise end up trying
to update state effectively in a render method, which is bad.
2017-03-29 15:05:49 +01:00
David Baker
ec63e18b42 Show spinner whilst processing recaptcha response
The fact that we showed no feedback whilst submitting the captcha
response was causing confusion on slower connections where this
took a nontrivial amount of time.

Takes a new flag from the js-sdk that indicates whether the
request being made is a background request, presenting a spinner
appropriately.

Requires https://github.com/matrix-org/matrix-js-sdk/pull/396
2017-03-21 18:40:41 +00:00
David Baker
878413f6a4 Support msisdn signin
Changes from https://github.com/matrix-org/matrix-react-sdk/pull/742
2017-03-14 11:50:13 +00:00
Richard van der Hoff
2786fb0f46 Revert "Support registration & login with phone number (#742)"
This reverts commit 0269562383.

This breaks against the current synapse release. We need to think more
carefully about backwards compatibility.
2017-03-09 18:32:44 +00:00
David Baker
0269562383 Support registration & login with phone number (#742)
* WIP msisdn sign in

* A mostly working country picker

* Fix bug where you'dbe logged out after registering

Stop the guest sync, otherwise it gets 401ed for using a guest
access token for a non-guest, causing us to beliebe we've been
logged out.

* Use InteractiveAuth component for registration

* Fix tests

* Remove old signup code

* Signup -> Login

Now that Signup contains no code whatsoever related to signing up,
rename it to Login. Get rid of the Signup class.

* Stray newline

* Fix more merge failing

* Get phone country & number to the right place

* More-or-less working msisdn auth component

* Send the bind_msisdn param on registration

* Refinements to country dropdown

Rendering the whole lot when the component was rendered just makes
the page load really slow, so just show 2 at a time and rely on
type-to-search.

Make type-to-search always display an exact iso2 match first

* Propagate initial inputs to the phone input

* Support msisdn login

* semicolon

* Fix PropTypes

* Oops, use the 1qst element of the array

Not the array of object keys which has no particular order

* Make dropdown/countrydropdown controlled

* Unused line

* Add note on DOM layout

* onOptionChange is required

* More docs

* Add missing propTypes

* Don't resume promise on error

* Use React.Children to manipulate children

* Make catch less weird

* Fix null dereference

Assuming [0] of an empty list == undefined doesn't work if you're
then taking a property of it.
2017-03-09 10:59:22 +00:00
David Baker
518a749d90 Add proptypes / isRequired 2017-03-02 14:36:54 +00:00
David Baker
c9ef879afa PR feedback: Move the email token request here 2017-03-01 16:04:15 +00:00
David Baker
454aa0757a Poll for authentication completion
on registration (both for email validation and completion of the
whole auth session).
2017-02-24 17:24:10 +00:00
David Baker
76b381b849 Spurious newline 2017-02-24 12:01:06 +00:00
David Baker
51467506f8 Port registration over to use InteractiveAuth
These changes are moved over from the dbkr/msisdn_signin branch
2017-02-24 11:41:23 +00:00
David Baker
43a740df15 Add busy param to docs 2017-02-14 10:34:43 +00:00
David Baker
ba3e62e395 Remove old docs 2017-02-14 10:31:56 +00:00
David Baker
36d126f3a9 PR feedback 2017-02-13 19:09:43 +00:00
David Baker
8fc3104507 Replace submit button with a spinner when busy
and update test accordingly
2017-02-13 18:52:33 +00:00
David Baker
77b226631a Copyright 2017-02-13 16:15:00 +00:00
David Baker
79d9deb339 Split out InterActiveAuthDialog
Into a component that does Interactive Auth and a dialog that
wraps it, so we can do interactive auth not necessarily in a
dialog.

As a side effect:
 * Put the buttons for each auth stage in the stage itself.
   Some stages don't have submit buttons (and it's very possible
   other stages may have other buttons entirely, like 'resend')
   so it makes more sense for the buttons to live in the stage
   components themselves. Plus it saves the slightly evil
   calling-functions-on-react-children thing we were doing (and
   indeed extending that to show the submit button at all).
 * Give all BaseDialogs a cross in the top right to cancel. They
   were all dismissable by clicking outside or pressing esc, so
   this adds a more visually obvious way of dismissing them. Plus,
   it means our InteractiveAuthDialog can have a way of canceling
   the whole operation separate from buttons for the individual
   stages.
2017-02-13 16:03:21 +00:00
Luke Barnard
40658494b4 Consider emails ending in matrix.org as a uni email
For the purposes of testing (and having a team page)
2017-02-09 09:29:55 +00:00
Luke Barnard
d9a8acd431 Redo team-based registration (#657)
For compatibility with referral campaign flows, re-implement team registration such that the team is selected through providing an email with a known team domain. The support email is now only shown when an email that _looks_ like a UK/US university email address, but is not known.
2017-01-27 16:31:36 +00:00
David Baker
18d4d3392a Fix a bunch of linting errors
eslint --fix and a few manual ones
2017-01-20 14:22:27 +00:00
lukebarnard
e06dd6e34a Implement auto-join rooms on registration
Also: This fixes registration with a team: only the email localpart was being used to register.

When a registration is successful, the user will be joined to rooms specified in the config.json teamsConfig:

"teamsConfig" : {
  "supportEmail": "support@riot.im",
  "teams": [
    {
      "name" : "matrix",
      "emailSuffix" : "matrix.org",
      "rooms" : [
        {
          "id" : "#irc_matrix:matrix.org",
          "autoJoin" : true
        }
      ]
    }
  ]
}

autoJoin can of course be set to false if the room should only be displayed on the (forthcoming) welcome page for each team, and not auto-joined.
2017-01-19 10:56:04 +01:00
Luke Barnard
5ef5204c8c Implement simple team-based registration (#620)
* Implement simple team-based registration

Config required goes in the `teams` top-level property in config.json. This consists of an array of team objects:
```json
{
  "name": "University of Bath",
  "emailSuffix": "bath.ac.uk"
}
```
These can be selected on registration and require a user to have a certain email address in order to register as part of a team. This is for vector-im/riot-web#2940. The next step would be sending users with emails matching the emailSuffix of a team to the correct welcome page as in vector-im/riot-web#2430.
2017-01-18 12:48:28 +01:00
Matthew Hodgson
e2e3bc0637 improve captcha warning 2016-12-24 18:40:20 +00:00
Matthew Hodgson
69b277b282 ask electron users to do captchas in a web browser.
This will happen anyway when they follow email verification links.
make captchas poll for success so if they are completed elsewhere, electron moves on
2016-12-24 03:15:30 +00:00
Matthew Hodgson
b1c4c759f4 blind fix for captcha on electron 2016-12-23 14:35:40 +00:00
David Baker
3f067cbdf6 Give our input fields names
Otherwise browsers' 'Remember Password' feature has to guess
badly and ends up putting the login username / password in the
first two password reset fields which is a bit odd.
2016-10-14 15:34:44 +01:00
David Baker
ef22ba1f39 Merge pull request #516 from matrix-org/rav/interactive_auth_dialog
InteractiveAuthDialog
2016-10-12 18:27:23 +01:00
Richard van der Hoff
1a81397d31 InteractiveAuthDialog
A dialog which will take the user through an interactive-auth process
2016-10-12 08:23:28 +01:00
Richard van der Hoff
eb36509620 Refactor CaptchaForm to put less logic in signupstages
A bunch of work being done in the Recaptcha signupstage makes more sense in
the CaptchaForm; let's move it.
2016-10-11 18:57:51 +01:00
David Baker
d5af2d2c52 Use 'Sign In' / 'Sign Out' universally
Rather than a mix of 'sign in/out' and 'log in/out'
2016-09-29 17:38:52 +01:00
Shell Turner
1380bf705a Fix CAS support by using a temporary Matrix client
Signed-off-by: Shell Turner <cam.turn@gmail.com>
2016-09-09 21:01:10 +01:00
David Baker
f469bbbb64 Refactor UI error effects
And add error effects to the login page to be consistent with the registration page
2016-08-03 15:59:17 +01:00
David Baker
345ed04ba9 Less enetering 2016-07-07 13:03:27 +01:00
David Baker
5c879d786e Doc the default params / guestUsername props 2016-07-07 11:23:08 +01:00
David Baker
e2c473b366 Error on registration if email taken
Use the new register-specific request token endpoint (https://github.com/matrix-org/matrix-js-sdk/pull/147) and catch the error that it gives if the email is already in use. Also add initial values to the registration form so we can reload it after the error without all the values disappearing, and split out the guest username parameter which was previously called defaultUsername.
2016-07-06 15:22:06 +01:00
David Baker
aca0e060a4 Also change velocity-vector commit & requires
Because it needs a versiob where the package name is actually updated and the requires need to use the right package name
2016-06-07 20:47:37 +01:00
David Baker
d5a522fdfe Second attempt at fixing the Velocity memory leak
1) Correct fix for Velociraptor (we need to find the DOM node and pass that in)
2) Do the same leak fix for the read marker
3) Update the dependency to our fork which is fixed to make the call we do to release memory actually work.
4) Remove the velocity-ui-pack dependency which is unnecessary because velocity-ui is included in the velocity package
2016-06-07 18:22:01 +01:00
Matthew Hodgson
0a346350e8 warn if you don't specify an email 2016-03-21 01:15:11 +00:00
Matthew Hodgson
bb918f198b don't let uses change HS/IS URL in the middle of registration - fixes https://github.com/vector-im/vector-web/issues/1176 2016-03-16 19:14:28 +00:00
Matthew Hodgson
b23cad5613 let registering guests either upgrade or create a new account by specifying a new username. fixes https://github.com/vector-im/vector-web/issues/1161 2016-03-15 18:36:13 +00:00
Matthew Hodgson
59866a2006 final PR feedback 2016-03-15 15:20:51 +00:00
Matthew Hodgson
438558da55 PR feedback 2016-03-15 13:48:46 +00:00
Matthew Hodgson
a82d3710d1 provide sensibile defaults for PasswordLogin 2016-03-06 18:42:09 -05:00
Matthew Hodgson
0bb58dd60c brings back the functionality in login/register/screens that got lost in @kegsay's refactor. specifically:
1) custom HS/IS urls are now persisted in HTML5 local storage.  As a result, all the login components now distinguish between default HS/IS URLs and custom specified ones again. (
2) custom HS/IS urls are synchronised between the instances of ServerConfig found in the Login, Registration and Forgot Password screens.
3) username are persisted over changing homeserver (but not password, to stop accidentally leaking passwords to the wrong server)
4) correctly interpret a blank URL field as meaning the placeholder text
5) when toggling custom URLs on and off, remember what the custom values were, and use the default URLs if custom mode is not engaged

also, guest access now upholds custom HS/IS URLs found in local storage rather than being limited to the server config ()

also adds assorted comments and improved console debug and a few minor cosmetic changes to the login components.

this commit sponsored by VS27...
2016-03-06 14:33:36 -05:00