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

TA-3: add auth middleware and get logged in user object #21

Merged
merged 1 commit into from
Sep 29, 2022

Conversation

andrewqian2001
Copy link
Contributor

@andrewqian2001 andrewqian2001 commented Sep 29, 2022

https://mcsapps.utm.utoronto.ca/jira/browse/TA-3

Added authentication middleware, allowing users to access protected routes (only get login user, delete is implemented so far)

Requires jsonwebtoken for authentication
image

Gets logged in user object if valid jwt
image

@andrewqian2001 andrewqian2001 merged commit 78d07bf into develop Sep 29, 2022
@andrewqian2001 andrewqian2001 deleted the UTSCHUB/feature/TA-3 branch September 29, 2022 18:10
@Henry-Zhuo Henry-Zhuo restored the UTSCHUB/feature/TA-3 branch October 2, 2022 22:28
andrewqian2001 added a commit that referenced this pull request Oct 3, 2022
Renaming the commit to include the ticket number, original ticket added authentication middleware and get logged in user object
@muntaqamahmood muntaqamahmood changed the title add auth middleware and get logged in user object TA-3:add auth middleware and get logged in user object Oct 3, 2022
@muntaqamahmood muntaqamahmood changed the title TA-3:add auth middleware and get logged in user object TA-3: add auth middleware and get logged in user object Oct 3, 2022
muntaqamahmood pushed a commit that referenced this pull request Oct 3, 2022
Renaming the commit to include the ticket number, original ticket added authentication middleware and get logged in user object
andrewqian2001 added a commit that referenced this pull request Oct 5, 2022
Renaming the commit to include the ticket number, original ticket added authentication middleware and get logged in user object
andrewqian2001 added a commit that referenced this pull request Oct 5, 2022
Renaming the commit to include the ticket number, original ticket added authentication middleware and get logged in user object
muntaqamahmood added a commit that referenced this pull request Oct 8, 2022
* add: backend dependencies

* patch: fix description

* feat: added backend api, server and routing for auth, items and users (#7)

* add: server set up

* add: routes for auth, items and users

* Added summary.md and changed project name

* Added process.md

* Setup client and separate server and client into separate directories (#9)

* Update README with initial development info

* Update README with backend server instructions

- specify web client server vs backend API server

* Move server files to server dir

- .gitignore should work from root dir

* Initialize client codebase as a React project

* Remove initial client gitignore and README

- these will be handled by repo level files

* Move server.js to server dir

* Clear README file. Will add in PR for README file

* Added team-contract.pdf

* Update PB.md

Added the format for User Stories.

* Update PB.md

Checking the format of PB.md

* Update PB.md

* Update PB.md

* fix: changed routes path (#10)

* Update PB.md

* Modified PB.md

* Bug fix: Summary.md

* Update competition.md

* Update competition.md

* Add user stories Henry is responsible for

* Update PB.md

* Update PB.md

* Updated Discord link

Updated Discord link with a new one that will not expire.

* Database set up complete (#11)

* Created inital connection to MongoDb

* Bug fix: removed space in package.json

* Removed routes file outdide server file

* Removed routes file outdide server file

* Finished process.md

* Update PB.md

* Initialize frontend with Yarn package manager (#13)

* Update README with initial development info

* Update README with backend server instructions

- specify web client server vs backend API server

* Update README development instructions to reflect separate server and client directories

* Update README file encoding to UTF-8

* deleted space in between UTSCHub in package.json

* added the react set-up packages

* move the helloworld dir under Client

* Update README.md

* Update README.md

* Update README.md

* Use client code originally stored in helloworld folder

* Switch to using yarn lockfile

* Track client public folder with Git
- Ignore server public folder as it is build directory

* Undo changes unrelated to frontend setup

* Separate server and client gitignores

- readded client starter gitignore but removed the comment with the link with more info on gitignore

* Update client package name

Co-authored-by: Shunm634-source <[email protected]>
Co-authored-by: Muntaqa Mahmood <[email protected]>

* Update PB.md

* Update PB.md

* Update PB.md

* Create README (#15)

* Update README with initial development info

* Update README with backend server instructions

- specify web client server vs backend API server

* Update README development instructions to reflect separate server and client directories

* Update README file encoding to UTF-8

* Update README.md

* Update README.md

* Update README.md

* Update README to use yarn commands for client project

* Move screenshot of working backend server to section for backend server

Co-authored-by: Muntaqa Mahmood <[email protected]>

* Update PB.md

* Added README.md

* Update PB.md

* Utschub/feature/ta-1 (#18)

* add: User schema and user validation

* add user registration and password hashing

* Utschub/feature/ta-2 (#19)

* added jsonwebtokens for login/registration for authentication

* added login feature

* Delete user using authentication token

* Revert "Delete user using authentication token"

This reverts commit 409ebbd.

* feature/TA-6: Delete User

Delete user using authentication token

* Revert "feature/TA-6: Delete User"

This reverts commit 44b74c2.

* Delete user using authentication token (#20)

* add auth middleware and get logged in user object (#21)

* feature: Created the signup react page under the client folder. (#24)

TA-7
* added signup page under client with error checking

Co-authored-by: Nandhakishore K.S <[email protected]>
Co-authored-by: Andrew Qian <[email protected]>

* TA-14: Add react-router-dom package for routing

* TA-14: Add routing capabilities to frontend

- Put Signup component at index route

* TA-14: Remove package-lock.json from frontend

- yarn.lock handles the package locks
- was accidentally added from commit 4c3e8f3 for PR #24

* TA-14: Add frontend page routing documentation

* TA-3: add auth middleware and get logged in user object (#21) (#22)

Renaming the commit to include the ticket number, original ticket added authentication middleware and get logged in user object

* Update sprint1.md

* TA-6: Delete user using authentication token (#20)

* add auth middleware and get logged in user object (#21)

* feature: Created the signup react page under the client folder. (#24)

TA-7
* added signup page under client with error checking

Co-authored-by: Nandhakishore K.S <[email protected]>
Co-authored-by: Andrew Qian <[email protected]>

* Sprint 0 Deliverables Complete (#17)

* add: backend dependencies

* patch: fix description

* feat: added backend api, server and routing for auth, items and users (#7)

* add: server set up

* add: routes for auth, items and users

* Added summary.md and changed project name

* Added process.md

* Setup client and separate server and client into separate directories (#9)

* Update README with initial development info

* Update README with backend server instructions

- specify web client server vs backend API server

* Move server files to server dir

- .gitignore should work from root dir

* Initialize client codebase as a React project

* Remove initial client gitignore and README

- these will be handled by repo level files

* Move server.js to server dir

* Clear README file. Will add in PR for README file

* Added team-contract.pdf

* Update PB.md

Added the format for User Stories.

* Update PB.md

Checking the format of PB.md

* Update PB.md

* Update PB.md

* fix: changed routes path (#10)

* Update PB.md

* Modified PB.md

* Bug fix: Summary.md

* Update competition.md

* Update competition.md

* Add user stories Henry is responsible for

* Update PB.md

* Update PB.md

* Updated Discord link

Updated Discord link with a new one that will not expire.

* Database set up complete (#11)

* Created inital connection to MongoDb

* Bug fix: removed space in package.json

* Removed routes file outdide server file

* Removed routes file outdide server file

* Finished process.md

* Update PB.md

* Initialize frontend with Yarn package manager (#13)

* Update README with initial development info

* Update README with backend server instructions

- specify web client server vs backend API server

* Update README development instructions to reflect separate server and client directories

* Update README file encoding to UTF-8

* deleted space in between UTSCHub in package.json

* added the react set-up packages

* move the helloworld dir under Client

* Update README.md

* Update README.md

* Update README.md

* Use client code originally stored in helloworld folder

* Switch to using yarn lockfile

* Track client public folder with Git
- Ignore server public folder as it is build directory

* Undo changes unrelated to frontend setup

* Separate server and client gitignores

- readded client starter gitignore but removed the comment with the link with more info on gitignore

* Update client package name

Co-authored-by: Shunm634-source <[email protected]>
Co-authored-by: Muntaqa Mahmood <[email protected]>

* Update PB.md

* Update PB.md

* Update PB.md

* Create README (#15)

* Update README with initial development info

* Update README with backend server instructions

- specify web client server vs backend API server

* Update README development instructions to reflect separate server and client directories

* Update README file encoding to UTF-8

* Update README.md

* Update README.md

* Update README.md

* Update README to use yarn commands for client project

* Move screenshot of working backend server to section for backend server

Co-authored-by: Muntaqa Mahmood <[email protected]>

* Update PB.md

* Added README.md

* Update PB.md

Co-authored-by: Andrew Qian <[email protected]>
Co-authored-by: Andrew Qian <[email protected]>
Co-authored-by: Henry Zhuo <[email protected]>
Co-authored-by: Muntaqa Mahmood <[email protected]>
Co-authored-by: JohnY2002 <[email protected]>
Co-authored-by: Henry-Zhuo <[email protected]>
Co-authored-by: Shunm634-source <[email protected]>

* Update PB.md

* Update PB.md

* Modified README.md

* Modified README.md

* Update PB.md

* Update README.md with Postman optional requirement

* Create UI.md

* Update README with Contribution information

* Update PB.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Delete team-contract.pdf

* Add files via upload

* Update process.md

* Update done.md

* Update competition.md

* Update competition.md

* Update summary.md

* Update summary.md

* Creating sprint1.md for Sprint1 deliverables

* Rough Draft - Story Point Distribution

Rough Draft for Jira Tasks, User Story Point Distribution.
Created Jira Tickets and the team voted on story points distribution for the first batch of User Stories in Sprint 1.

* Update sprint1.md

* Update sprint1.md

* sprint 0 marks

* Update sprint0_rubric.md

* TA-14: Add react-router-dom package for routing

* TA-14: Add routing capabilities to frontend

- Put Signup component at index route

* TA-14: Remove package-lock.json from frontend

- yarn.lock handles the package locks
- was accidentally added from commit 4c3e8f3 for PR #24

* TA-14: Add frontend page routing documentation

* TA-3: add auth middleware and get logged in user object (#21) (#22)

Renaming the commit to include the ticket number, original ticket added authentication middleware and get logged in user object

* Update sprint1.md

* TA-18: Updated sprint1.md with stand-up updates from stand-up 2 held on October 2nd, 2022.

* Utschub/feature/ta 10 (#30)

* TA-10 added login with error messages





Co-authored-by: Andrew Qian <[email protected]>

* TA-3: add auth middleware and get logged in user object (#21)

* feature: Created the signup react page under the client folder. (#24)

TA-7
* added signup page under client with error checking

Co-authored-by: Nandhakishore K.S <[email protected]>
Co-authored-by: Andrew Qian <[email protected]>

* Sprint 0 Deliverables Complete (#17)

* add: backend dependencies

* patch: fix description

* feat: added backend api, server and routing for auth, items and users (#7)

* add: server set up

* add: routes for auth, items and users

* Added summary.md and changed project name

* Added process.md

* Setup client and separate server and client into separate directories (#9)

* Update README with initial development info

* Update README with backend server instructions

- specify web client server vs backend API server

* Move server files to server dir

- .gitignore should work from root dir

* Initialize client codebase as a React project

* Remove initial client gitignore and README

- these will be handled by repo level files

* Move server.js to server dir

* Clear README file. Will add in PR for README file

* Added team-contract.pdf

* Update PB.md

Added the format for User Stories.

* Update PB.md

Checking the format of PB.md

* Update PB.md

* Update PB.md

* fix: changed routes path (#10)

* Update PB.md

* Modified PB.md

* Bug fix: Summary.md

* Update competition.md

* Update competition.md

* Add user stories Henry is responsible for

* Update PB.md

* Update PB.md

* Updated Discord link

Updated Discord link with a new one that will not expire.

* Database set up complete (#11)

* Created inital connection to MongoDb

* Bug fix: removed space in package.json

* Removed routes file outdide server file

* Removed routes file outdide server file

* Finished process.md

* Update PB.md

* Initialize frontend with Yarn package manager (#13)

* Update README with initial development info

* Update README with backend server instructions

- specify web client server vs backend API server

* Update README development instructions to reflect separate server and client directories

* Update README file encoding to UTF-8

* deleted space in between UTSCHub in package.json

* added the react set-up packages

* move the helloworld dir under Client

* Update README.md

* Update README.md

* Update README.md

* Use client code originally stored in helloworld folder

* Switch to using yarn lockfile

* Track client public folder with Git
- Ignore server public folder as it is build directory

* Undo changes unrelated to frontend setup

* Separate server and client gitignores

- readded client starter gitignore but removed the comment with the link with more info on gitignore

* Update client package name

Co-authored-by: Shunm634-source <[email protected]>
Co-authored-by: Muntaqa Mahmood <[email protected]>

* Update PB.md

* Update PB.md

* Update PB.md

* Create README (#15)

* Update README with initial development info

* Update README with backend server instructions

- specify web client server vs backend API server

* Update README development instructions to reflect separate server and client directories

* Update README file encoding to UTF-8

* Update README.md

* Update README.md

* Update README.md

* Update README to use yarn commands for client project

* Move screenshot of working backend server to section for backend server

Co-authored-by: Muntaqa Mahmood <[email protected]>

* Update PB.md

* Added README.md

* Update PB.md

Co-authored-by: Andrew Qian <[email protected]>
Co-authored-by: Andrew Qian <[email protected]>
Co-authored-by: Henry Zhuo <[email protected]>
Co-authored-by: Muntaqa Mahmood <[email protected]>
Co-authored-by: JohnY2002 <[email protected]>
Co-authored-by: Henry-Zhuo <[email protected]>
Co-authored-by: Shunm634-source <[email protected]>

* Update PB.md

* Update PB.md

* Modified README.md

* Modified README.md

* Update PB.md

* Update README.md with Postman optional requirement

* Create UI.md

* Update README with Contribution information

* Update PB.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Delete team-contract.pdf

* Add files via upload

* Update process.md

* Update done.md

* Update competition.md

* Update competition.md

* Update summary.md

* Update summary.md

* Creating sprint1.md for Sprint1 deliverables

* Rough Draft - Story Point Distribution

Rough Draft for Jira Tasks, User Story Point Distribution.
Created Jira Tickets and the team voted on story points distribution for the first batch of User Stories in Sprint 1.

* Update sprint1.md

* Update sprint1.md

* sprint 0 marks

* Update sprint0_rubric.md

* TA-14: Add react-router-dom package for routing

* TA-14: Add routing capabilities to frontend

- Put Signup component at index route

* TA-14: Remove package-lock.json from frontend

- yarn.lock handles the package locks
- was accidentally added from commit 4c3e8f3 for PR #24

* TA-14: Add frontend page routing documentation

* TA-3: add auth middleware and get logged in user object (#21) (#22)

Renaming the commit to include the ticket number, original ticket added authentication middleware and get logged in user object

* Update sprint1.md

* feature: Created the signup react page under the client folder. (#24)

TA-7
* added signup page under client with error checking

Co-authored-by: Nandhakishore K.S <[email protected]>
Co-authored-by: Andrew Qian <[email protected]>

* Sprint 0 Deliverables Complete (#17)

* add: backend dependencies

* patch: fix description

* feat: added backend api, server and routing for auth, items and users (#7)

* add: server set up

* add: routes for auth, items and users

* Added summary.md and changed project name

* Added process.md

* Setup client and separate server and client into separate directories (#9)

* Update README with initial development info

* Update README with backend server instructions

- specify web client server vs backend API server

* Move server files to server dir

- .gitignore should work from root dir

* Initialize client codebase as a React project

* Remove initial client gitignore and README

- these will be handled by repo level files

* Move server.js to server dir

* Clear README file. Will add in PR for README file

* Added team-contract.pdf

* Update PB.md

Added the format for User Stories.

* Update PB.md

Checking the format of PB.md

* Update PB.md

* Update PB.md

* fix: changed routes path (#10)

* Update PB.md

* Modified PB.md

* Bug fix: Summary.md

* Update competition.md

* Update competition.md

* Add user stories Henry is responsible for

* Update PB.md

* Update PB.md

* Updated Discord link

Updated Discord link with a new one that will not expire.

* Database set up complete (#11)

* Created inital connection to MongoDb

* Bug fix: removed space in package.json

* Removed routes file outdide server file

* Removed routes file outdide server file

* Finished process.md

* Update PB.md

* Initialize frontend with Yarn package manager (#13)

* Update README with initial development info

* Update README with backend server instructions

- specify web client server vs backend API server

* Update README development instructions to reflect separate server and client directories

* Update README file encoding to UTF-8

* deleted space in between UTSCHub in package.json

* added the react set-up packages

* move the helloworld dir under Client

* Update README.md

* Update README.md

* Update README.md

* Use client code originally stored in helloworld folder

* Switch to using yarn lockfile

* Track client public folder with Git
- Ignore server public folder as it is build directory

* Undo changes unrelated to frontend setup

* Separate server and client gitignores

- readded client starter gitignore but removed the comment with the link with more info on gitignore

* Update client package name

Co-authored-by: Shunm634-source <[email protected]>
Co-authored-by: Muntaqa Mahmood <[email protected]>

* Update PB.md

* Update PB.md

* Update PB.md

* Create README (#15)

* Update README with initial development info

* Update README with backend server instructions

- specify web client server vs backend API server

* Update README development instructions to reflect separate server and client directories

* Update README file encoding to UTF-8

* Update README.md

* Update README.md

* Update README.md

* Update README to use yarn commands for client project

* Move screenshot of working backend server to section for backend server

Co-authored-by: Muntaqa Mahmood <[email protected]>

* Update PB.md

* Added README.md

* Update PB.md

Co-authored-by: Andrew Qian <[email protected]>
Co-authored-by: Andrew Qian <[email protected]>
Co-authored-by: Henry Zhuo <[email protected]>
Co-authored-by: Muntaqa Mahmood <[email protected]>
Co-authored-by: JohnY2002 <[email protected]>
Co-authored-by: Henry-Zhuo <[email protected]>
Co-authored-by: Shunm634-source <[email protected]>

* Update PB.md

* Update PB.md

* Update competition.md

* Update competition.md

* TA-14: Add react-router-dom package for routing

* TA-14: Remove package-lock.json from frontend

- yarn.lock handles the package locks
- was accidentally added from commit 4c3e8f3 for PR #24

* TA-3: add auth middleware and get logged in user object (#21) (#22)

Renaming the commit to include the ticket number, original ticket added authentication middleware and get logged in user object

* Utschub/feature/ta 10 (#30)

* TA-10 added login with error messages





Co-authored-by: Andrew Qian <[email protected]>

* Update PB.md

* Update PB.md

* TA-13: Added the AboutUs page

* TA-10 added login in progress

* TA-10 added error checking work in progress

* TA-10 added error checking work in progress

* TA-10: fix server response

* TA-10: Added error checking work in progress

* TA-10: Finished all features for log in page.

* TA-10 added login in progress

* TA-10 added error checking work in progress

* TA-10 added error checking work in progress

* TA-10: fix server response

* TA-10: Added error checking work in progress

* TA-10: Changed the routing from Signup-Dashboard to Signup-Login.

* TA-10: Deleted the duplicate Login.js file

* TA-18: Added System Design Document

* TA-18: Added RPM.md file and updated it.

* TA-18: Fixed format of RPM.md

* TA-18: Editing System Design Doc.

* TA-18: Updated sprint1.md

* TA-15: Add Navbar and Home components

- added .yarn to client .gitignore
- TODO: fix client yarn.lock merge conflict

* TA-15: Temporarily revert yarn.lock

* TA-15: Move homepage out of Home folder

* TA15:add cover background and quit account button

* TA-15: add background colour and inline css for button

* TA-15: Display username in profileInfo

- get username and email on login
- update axios
- removed Login.js and Dashboard.jsx
- support logging out from dashboard
- navigate to Home page instead of Dashboard on login

* TA-15: Testing username being displayed

* TA-18: Documentation for Backend

* TA-18: Updating Backend Documentation

* TA-15: Display username and email in dashboard

* TA-15: Comment out getUser and getEmail testing code

* Adding screenshots

Adding screenshots to the documentation for backend

* TA-15: Display username on login. Removed Login.js.

* TA-15: Testing removeUserSession

* TA-15: Display username and email on login

* TA-15: Testing username and email session string output

* TA-15: fix delete user

* TA-15: add delete account button

* TA-15: Navigate to dashboard when user data is retrieved

- fixes race condition with user data being retrieved after navigation
- added error handler to navigate to dashboard and let user know there was an error

* TA-15: Update text for items for sale button

* TA-15: Clean up code styling in Home.jsx, Login.jsx, and Common.js

* TA-15: Remove unused comment about checking controller file that was removed

* TA-15: Add gitignore at project root for .DS_Store file

- Removed .DS_Store file

* TA-15: Removed root level package-lock.json

* TA-15: Removed client package-lock.json in favor of yarn.lock

* TA-15: Regenerate yarn.lock

* TA-15: Clean up code styling in profileInfo.jsx

* TA-18: Adding screenshots

TA-18: Adding screenshots to the documentation for backend

* TA-18: Finished RPM.md, updating sprint1.md

* TA-18: Sprint 1 Deliverables complete

* TA-13: deleted duplicated login file

* TA-18: Updating sprint1 deliverables

* TA-5/Naviagtion Bar (#36)

* TA-5/Created the base for sidebar

* TA-5/Created a Side Bar with icons and chanegd the color dynamics and alignment

* TA-5: Grab changes from old TA-5 branch

- original merge by [email protected], using TA-5-fixed, while TA-5 branch was off of old develop
- Includes .js files for pages, css, login_pages/, and Dashboard.js

* TA-5/fixed bugs

- Resolve merge conflict in index.css
- add packages for styling

* TA-5: Regenerate yarn lockfile

* TA-5: Deleted few files

- deleted .js files for React components for login_pages
- deleted client/src/Navbar
- using Login and Signup files in client/src/ instead of login_pages

* TA-5/Fixed bugs

- update paths for imports in client/src/index.js
- use Home component at /dashboard route
- use ProfileInfo component at /profile route
- removed /about and /settings routes
- lockfiles changed

* TA-5: Regenerate yarn.lock and remove package-lock.json

* TA-5: Rename Navbar file to Navbar.js

* TA-5: Rename pages files to have first letter capitalized and use .jsx extension

- deleted Dashboard.js in favor of ProfileInfo.jsx

* TA-5: Move Login.jsx, Signup.jsx, and signupLogin.css to Pages folder

- reordered index.js imports

Co-authored-by: Henry-Zhuo <[email protected]>

Co-authored-by: Andrew Qian <[email protected]>
Co-authored-by: Andrew Qian <[email protected]>
Co-authored-by: Nandhakishore K.S <[email protected]>
Co-authored-by: Muntaqa Mahmood <[email protected]>
Co-authored-by: JohnY2002 <[email protected]>
Co-authored-by: ksnandz <[email protected]>
Co-authored-by: Shunm634-source <[email protected]>
Co-authored-by: Shun Murai <[email protected]>
Co-authored-by: Shence <[email protected]>
Co-authored-by: joy <[email protected]>
Co-authored-by: JohnY2002 <[email protected]>
Co-authored-by: Shence <[email protected]>
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.

2 participants