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

Firebase Admin Refactor + JWT feature #180

Merged
merged 19 commits into from
Feb 29, 2024
Merged

Firebase Admin Refactor + JWT feature #180

merged 19 commits into from
Feb 29, 2024

Conversation

AlexanderWangY
Copy link
Collaborator

@AlexanderWangY AlexanderWangY commented Feb 25, 2024

Closes #154
Closes #163

Changelog:

  • Changed backend from firebase web modular api to admin sdk
  • Cleaned up some code
  • Deleted firebaseInit.ts
  • Add JWT Authorization to backend
  • Configured SocketContext to handle socket state and send tokens back
  • Also made some minor changes to log in page to make it load smoother

AlexanderWangY and others added 5 commits February 17, 2024 20:55
* new branch + function fix

* small bug fixes

* fixes pt2

* JWT WIP

* new branch + function fix

* small bug fixes

* fixes pt2

* JWT WIP

* new branch + function fix

* small bug fixes

* fixes pt2

* JWT WIP

* new branch + function fix

* small bug fixes

* added passport

* started auth + admin sdk

* removed passport

* added private key to gitignore

* Delete server/private_keys/private.json

---------

Co-authored-by: AlexanderWangY <[email protected]>
* new branch + function fix

* small bug fixes

* fixes pt2

* JWT WIP

* new branch + function fix

* small bug fixes

* fixes pt2

* JWT WIP

* new branch + function fix

* small bug fixes

* fixes pt2

* JWT WIP

* new branch + function fix

* small bug fixes

* added passport

* started auth + admin sdk

* removed passport

* added private key to gitignore

* Delete server/private_keys/private.json

* initializing firestore in admin

* finished most of action refactoring

* Made error case for email in use display correctly in front end (#158)

* changed getConnectedUsers to admin

* migrated to firebase-admin

---------

Co-authored-by: AlexanderWangY <[email protected]>
Co-authored-by: Mohammed Ali <[email protected]>
* Made error case for email in use display correctly in front end

* Made error case for email in use display correctly in front end (#158)

* Cleaned up useEffect function #159

* Added testing pipeline (#175)

* Create main.yml

* Update main.yml

* Update _layout.tsx

* Update main.yml

* Update socketio.test.ts

* Update socketio.test.ts

* Update _layout.tsx

* User Context and User Type created and wrapped chat screen (#131)

* added user context

* Added userID and displayName

* moved user and display name generation into UserProvider

* Improved UserContext implementation

Amongst these changes, the user type on the frontend has been edited in order
to prevent hidden functions that would pull information into the UserContext
from other contexts. The message type was also modified to keep a new author
section with a displayName attribute. An issue should be created for a socket
API endpoint for grabbing the displayName, and one to set it in a connectedUser
document in the databse.

* updated package lock

---------

Co-authored-by: h1divp <[email protected]>

* Set up Firebase-Admin in adminInit.ts (#155)

* new branch + function fix

* small bug fixes

* fixes pt2

* JWT WIP

* new branch + function fix

* small bug fixes

* fixes pt2

* JWT WIP

* new branch + function fix

* small bug fixes

* fixes pt2

* JWT WIP

* new branch + function fix

* small bug fixes

* added passport

* started auth + admin sdk

* removed passport

* added private key to gitignore

* Delete server/private_keys/private.json

---------

Co-authored-by: AlexanderWangY <[email protected]>

* Refactored most of the actions (#156)

* new branch + function fix

* small bug fixes

* fixes pt2

* JWT WIP

* new branch + function fix

* small bug fixes

* fixes pt2

* JWT WIP

* new branch + function fix

* small bug fixes

* fixes pt2

* JWT WIP

* new branch + function fix

* small bug fixes

* added passport

* started auth + admin sdk

* removed passport

* added private key to gitignore

* Delete server/private_keys/private.json

* initializing firestore in admin

* finished most of action refactoring

* Made error case for email in use display correctly in front end (#158)

* changed getConnectedUsers to admin

* migrated to firebase-admin

---------

Co-authored-by: AlexanderWangY <[email protected]>
Co-authored-by: Mohammed Ali <[email protected]>

* added middleware

---------

Co-authored-by: Phantom0110 <[email protected]>
Co-authored-by: Mohammed Ali <[email protected]>
Co-authored-by: AaronGibson2 <[email protected]>
Co-authored-by: h1divp <[email protected]>
Co-authored-by: AlexanderWangY <[email protected]>
@AlexanderWangY AlexanderWangY added Backend📡 Issues corresponding to the backend/API. Frontend 🖥 Issues corresponding to the frontend/client. Hard You should be an active contributor to work on this issue labels Feb 25, 2024
@AlexanderWangY
Copy link
Collaborator Author

AlexanderWangY commented Feb 25, 2024

Don't worry about the failed unit test, I will be fixing that soon!

Edit: Oops, accidentally closed with comment hehe

* Update socket tests (#185)

* Update socket tests

* Remove unused type

* Update comment in socketio.test.ts

---------

Co-authored-by: Phoenix <[email protected]>

* Create subdirectory before creating service account JSON

---------

Co-authored-by: Phoenix <[email protected]>
@h1divp h1divp self-requested a review February 27, 2024 19:48
@h1divp
Copy link
Collaborator

h1divp commented Feb 29, 2024

Everything works after the migration, thank you for your work.

Please update the backend docs on how to add the new firebase admin secrets, especially by CC tomorrow if you can. I left a comment inside of config_example.md but this should be in the official docs after this PR is merged.

Good work!

@h1divp h1divp merged commit d2a2241 into main Feb 29, 2024
1 check passed
@AlexanderWangY AlexanderWangY deleted the firebase-jwt-feature branch March 7, 2024 00:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Backend📡 Issues corresponding to the backend/API. Frontend 🖥 Issues corresponding to the frontend/client. Hard You should be an active contributor to work on this issue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement Firebase JWT when making Server Requests Migrate Backend firebase/app to firebase-admin SDK
3 participants