Skip to content

Authenticate user for trip#76

Merged
keiffer01 merged 9 commits into
masterfrom
authenticate-user-for-trip
Jul 28, 2020
Merged

Authenticate user for trip#76
keiffer01 merged 9 commits into
masterfrom
authenticate-user-for-trip

Conversation

@keiffer01
Copy link
Copy Markdown
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 requested review from anan-ya-y and zghera July 17, 2020 07:06
@keiffer01 keiffer01 self-assigned this Jul 17, 2020
@keiffer01 keiffer01 linked an issue Jul 17, 2020 that may be closed by this pull request
Comment thread frontend/src/components/ViewActivities/index.js
Comment thread frontend/src/components/ViewActivities/index.test.js
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
Comment thread frontend/src/components/ViewActivities/index.js
@keiffer01 keiffer01 marked this pull request as ready for review July 22, 2020 19:53
Comment thread frontend/src/components/ViewActivities/index.js
Comment thread frontend/src/components/ViewActivities/index.js
@keiffer01 keiffer01 requested a review from HiramSilvey July 27, 2020 19:27
@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