Commit Graph

32 Commits

Author SHA1 Message Date
chrisw
a4a3472191 add catch for http error on invite token check 2018-03-08 14:36:31 +00:00
Chris Hill-Scott
f3a0c505bd Enforce order and style of imports
Done using isort[1], with the following command:
```
isort -rc ./app ./tests
```

Adds linting to the `run_tests.sh` script to stop badly-sorted imports
getting re-introduced.

Chosen style is ‘Vertical Hanging Indent’ with trailing commas, because
I think it gives the cleanest diffs, eg:
```
from third_party import (
    lib1,
    lib2,
    lib3,
    lib4,
)
```

1. https://pypi.python.org/pypi/isort
2018-02-27 16:35:13 +00:00
chrisw
22bbc0d6d8 invite-team-members 2018-02-23 11:43:13 +00:00
Katie Smith
309396c906 Make email addresses case insensitive when inviting users to services
Email addresses in invites should be case insensitive. This is to stop
the bug where a user creates their account using a lower case email
address (e.g. user1@gov.uk), but is then invited to a service using
their email address in a different case (e.g. USER1.gov.uk) and sees
an error message telling them that they can't accept an invite for a
different email address.
2018-01-02 09:26:49 +00:00
Leo Hemsted
ddf88b70c0 clean up logic around existing users accepting invites
* if the service issuing the invite does not have permission to edit
  auth types, don't let them do anything. This will stop them turning
  existing email_auth users back to sms auth
* if the user hasn't got a mobile number, but the invite is for sms
  login, don't do anything either. They won't have a phone number if
  they signed up via an email_auth invite previously.

in these cases, we accept the invite and add the user to the service
as normal, however, just don't update the user's auth type.
2017-11-15 17:19:32 +00:00
Leo Hemsted
ab4504f517 fix logged in user not having auth type set from invite 2017-11-15 15:42:23 +00:00
Leo Hemsted
04adb15e85 make sure old invites get the proper message
we were accidentally covering up the expiry message with a more
generic one
2017-11-02 13:49:24 +00:00
Leo Hemsted
9eb5e6a532 make sure invite tokens still check token on admin for error handler to kick in 2017-11-01 16:17:04 +00:00
Adam Shimali
0544ea776b Change when invite gets marked as accepeted. 2016-06-08 11:52:26 +01:00
Adam Shimali
09117e5eeb Updated flask-login to version 0.3.2 2016-05-04 14:06:14 +01:00
Rebecca Law
a183d8d366 Missed the anchor tag in the mark up - oops. 2016-04-26 12:15:25 +01:00
Rebecca Law
8141ea87d0 Wrap message in Markup 2016-04-26 12:12:47 +01:00
Rebecca Law
60c55ca9e2 Fix anchor tag in flash message.
https://www.pivotaltracker.com/story/show/117513779
2016-04-26 12:03:35 +01:00
Rebecca Law
1fe5ae0371 This pull request removes the need for the req and pay in the claims JWT.
Use the new version of the notifications-python-client. This version no longer adds the req and pay to the claims of the jwt.

The change is backward compatible so an older client that sends a JWT with the extra claims will pass authentication.
Once all the clients have been updated to not include the extra claims some updates to exclude them from the method signatures will happen as well.

The documentation has been updated to reflect this change.

https://www.pivotaltracker.com/story/show/116971293
2016-04-15 11:04:35 +01:00
Chris Hill-Scott
25079464b0 More helpful error when signed in an accept invite 2016-04-08 10:55:20 +01:00
Adam Shimali
fc01735d70 Removed some un needed flash messages raised as bugs.
In the process found a couple of edge cases of incorrect
use of invitation links by other users which are now
handled.
2016-03-31 09:44:01 +01:00
Nicholas Staples
644336b151 Merge with master. 2016-03-29 22:50:40 +01:00
Rebecca Law
461b374f68 Do not throw 404 if email address is not found on sign in.
https://www.pivotaltracker.com/story/show/115947639
2016-03-21 11:48:16 +00:00
Adam Shimali
2792bece54 Changed registration flow to first send email verification link that
when visited sends sms code for second step of account verification.

At that second step user enters just sms code sent to users mobile
number.

Also moved dao calls that simply proxied calls to client to calling
client directly.

There is still a place where a user will be a sent a code for
verification to their email namely if they update email address.
2016-03-17 15:19:51 +00:00
Adam Shimali
7dca13407c Additional check needed to see if user was already a user for the
service that they were invited to.
2016-03-15 15:32:30 +00:00
Rebecca Law
4ba801edab Merge branch 'master' into error-handling
Conflicts:
	app/main/views/invites.py
2016-03-10 15:03:21 +00:00
Adam Shimali
986edfa317 Check user invite status not accepted before proceeding with flow. 2016-03-10 11:57:40 +00:00
Rebecca Law
f6d98b63ea Refactored register_errorhandlers so that it handles HTTPError
Remove most cases where we catch HTTPError
2016-03-10 11:53:29 +00:00
Adam Shimali
acc7c6cda3 Display email address that invitee will be registered with.
Also add flash message for users who already have an account.
2016-03-09 11:27:26 +00:00
Adam Shimali
9bc5d08d52 Flash message to confirm invitation accepted and user has been
added to service.
2016-03-08 08:18:41 +00:00
Rebecca Law
41b08b7ca1 Added from_user name and service name for the cancelled invitation message. 2016-03-04 15:17:04 +00:00
Rebecca Law
8074c6ea7f Add cancelled-invite html.
If a invited user accepts a cancelled invitation they are directed to a page telling them the invitation is cancelled.
Without this they were able to register and were added to the service.
2016-03-04 14:42:52 +00:00
Adam Shimali
a974e6e157 [WIP] Add call to api to update invitation to accepted.
When flow for invited user is complete, that is
when user has been added to service, update invitation
to accepted
2016-03-03 18:13:56 +00:00
Adam Shimali
1ff9d671eb [WIP] pass invite instead of permissions to make update of invite easier if all goes well 2016-03-03 16:37:22 +00:00
Adam Shimali
6ba13a6513 [WIP] New user can now accept invite and will be made to
register. On succesful register and verfication they
will be added to service and forwarded to dashboard.

Nothing is done yet with the permissions requested in the
invite to the user.
2016-03-02 17:52:32 +00:00
Adam Shimali
5f02d4cefe [WIP] Post does not need any data
Invites rest module can use invited user object instead
of dict.
2016-03-01 17:23:23 +00:00
Adam Shimali
5f3c72729e [WIP] Start of user accepting invite.
This commit only deals with acceptance by
users who are already in system.

Changed invite client to return invited user objects
instead of dictionaries.

Added commented out test. fixed up fixtures to return invited user
object for invites
2016-03-01 14:10:35 +00:00