Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Authenticate user for trip #76

Merged
merged 9 commits into from
Jul 28, 2020
Merged

Authenticate user for trip #76

merged 9 commits into from
Jul 28, 2020

Conversation

keiffer01
Copy link
Collaborator

What is a quick description of the change?

Adds an extra check on the VIEW_ACTIVITIES page to ensure that the logged-in user is a collaborator of the trip. If not, they receive an error message instead.

Is this fixing an issue?

Fixes #60

Are there more details that are relevant?

The index.js file of the ViewActivities component is added to. When the component mounts, it makes a query to Firestore to grab the collaborators for the requested trip. The possible rendered elements are:

  • If the component is still fetching data form Firestore, a Loading screen is displayed.
  • If Firebase returns an error, a generic error message is shown.
  • If the trip doesn't exist, an error message reflecting that is shown.
  • If the user is not a collaborator of the trip, an error message reflecting that is shown.
  • If the user is a collaborator, the ActivityList component is rendered as normal.

Check lists (check x in [ ] of list items)

  • Test written/updating
  • Tests passing
  • Coding style (indentation, etc)

Any additional comments?

GIF below (it is dark because I was using a Night Mode extension):
Untitled_ Jul 17, 2020 1_36 AM

@keiffer01 keiffer01 self-assigned this Jul 17, 2020
@keiffer01 keiffer01 linked an issue Jul 17, 2020 that may be closed by this pull request
Base automatically changed from auth-utils to master July 20, 2020 22:35
@keiffer01 keiffer01 requested a review from zghera July 21, 2020 23:11
@keiffer01 keiffer01 marked this pull request as ready for review July 22, 2020 19:53
@keiffer01 keiffer01 merged commit e213e4f into master Jul 28, 2020
@keiffer01 keiffer01 deleted the authenticate-user-for-trip branch July 28, 2020 16:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Authenticate user when they are viewing a specific trip
5 participants