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

Set up authentication with Firebase #57

Merged
merged 44 commits into from May 20, 2022
Merged

Set up authentication with Firebase #57

merged 44 commits into from May 20, 2022

Conversation

joulev
Copy link
Owner

@joulev joulev commented May 17, 2022

This task list will be updated live.

  • Create new users via Google
  • Create new users via GitHub
  • Create new users via email links (passwordless authentication) (Email-based authentication will not be supported #59, last commit to support this: 44aed54)
  • Users can log in and log out normally
  • Users can update name
  • Users can update avatar (await integration with storage)
  • Users can update email (users will identify by uid instead)
  • Users can link account to other accounts (Google and GitHub)
  • Users can export all personal information stored (await integration with database)
  • Users can delete the account
  • Loading screen for all pages under authentication (/auth, /app/dashboard and /app/account done; the rest are to be progressively updated as we integrate them with the backend)
  • Verbose error handling
  • Tests (Since the authentication method is not yet decided, this will be done when we actually know what we will use.)

joulev added 15 commits May 16, 2022 22:28
Signed-off-by: Vu Van Dung <joulev.vvd@yahoo.com>
Signed-off-by: Vu Van Dung <joulev.vvd@yahoo.com>
Signed-off-by: Vu Van Dung <joulev.vvd@yahoo.com>
Signed-off-by: Vu Van Dung <joulev.vvd@yahoo.com>
Signed-off-by: Vu Van Dung <joulev.vvd@yahoo.com>
Signed-off-by: Vu Van Dung <joulev.vvd@yahoo.com>
Signed-off-by: Vu Van Dung <joulev.vvd@yahoo.com>
https://nextjs.org/docs/basic-features/layouts#per-page-layouts

Earlier I wondered what is the difference between the two ways. Today I finally understand.

Just wrap the layout inside a context provider and you will understand too. Same reason why theme.test.tsx needs three separate components to test.

Signed-off-by: Vu Van Dung <joulev.vvd@yahoo.com>
Signed-off-by: Vu Van Dung <joulev.vvd@yahoo.com>
Because authentication via redirecting is mysteriously ridiculously and terribly slow.

https://stackoverflow.com/q/54385124

Firebase, slower than a snail

Signed-off-by: Vu Van Dung <joulev.vvd@yahoo.com>
We will use passwordless sign-in for all authentication methods, because that's how auth should work in 2022.

Signed-off-by: Vu Van Dung <joulev.vvd@yahoo.com>
Signed-off-by: Vu Van Dung <joulev.vvd@yahoo.com>
Signed-off-by: Vu Van Dung <joulev.vvd@yahoo.com>
Signed-off-by: Vu Van Dung <joulev.vvd@yahoo.com>
Signed-off-by: Vu Van Dung <joulev.vvd@yahoo.com>
@codecov
Copy link

codecov bot commented May 17, 2022

Codecov Report

Merging #57 (e6d4dcf) into main (ecf4cf5) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##             main      #57   +/-   ##
=======================================
  Coverage   98.27%   98.27%           
=======================================
  Files          26       26           
  Lines         348      348           
  Branches       87       87           
=======================================
  Hits          342      342           
  Misses          6        6           
Impacted Files Coverage Δ
packages/client/components/copiableCode.tsx 100.00% <ø> (ø)
packages/client/components/footer.tsx 91.30% <ø> (ø)
packages/client/constants/sampleCommentCode.ts 100.00% <ø> (ø)
packages/client/components/banner.tsx 100.00% <100.00%> (ø)
packages/client/components/home/navbar.tsx 96.29% <100.00%> (ø)

Signed-off-by: Vu Van Dung <joulev.vvd@yahoo.com>
Signed-off-by: Vu Van Dung <joulev.vvd@yahoo.com>
Signed-off-by: Vu Van Dung <joulev.vvd@yahoo.com>
Signed-off-by: Vu Van Dung <joulev.vvd@yahoo.com>
Signed-off-by: Vu Van Dung <joulev.vvd@yahoo.com>
Signed-off-by: Vu Van Dung <joulev.vvd@yahoo.com>
Signed-off-by: Vu Van Dung <joulev.vvd@yahoo.com>
We don't need a separate layout for one single page

Signed-off-by: Vu Van Dung <joulev.vvd@yahoo.com>
Signed-off-by: Vu Van Dung <joulev.vvd@yahoo.com>
Signed-off-by: Vu Van Dung <joulev.vvd@yahoo.com>
Signed-off-by: Vu Van Dung <joulev.vvd@yahoo.com>
Signed-off-by: Vu Van Dung <joulev.vvd@yahoo.com>
@joulev
Copy link
Owner Author

joulev commented May 20, 2022

How fool I was to think getAuth().currentUser is reactive at all. We still need a React global state after all.

This reverts commit 21b6ffc.

Signed-off-by: Vu Van Dung <joulev.vvd@yahoo.com>
Signed-off-by: Vu Van Dung <joulev.vvd@yahoo.com>
Signed-off-by: Vu Van Dung <joulev.vvd@yahoo.com>
Signed-off-by: Vu Van Dung <joulev.vvd@yahoo.com>
Signed-off-by: Vu Van Dung <joulev.vvd@yahoo.com>
@joulev joulev marked this pull request as ready for review May 20, 2022 15:18
@joulev
Copy link
Owner Author

joulev commented May 20, 2022

Some tasks cannot be worked on at the moment, see the top comment for more details. Otherwise, review is complete with e6d4dcf. Look good to go.

@joulev joulev merged commit 93d0e6c into main May 20, 2022
@joulev joulev deleted the fe-with-firebase branch May 20, 2022 15:20
@joulev joulev added the frontend All issues related to the front-end label May 20, 2022
@joulev joulev moved this from In Progress to Done in ezkomment project May 20, 2022
joulev added a commit that referenced this pull request May 23, 2022
Signed-off-by: Vu Van Dung <joulev.vvd@yahoo.com>
@joulev joulev self-assigned this Jun 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
frontend All issues related to the front-end
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

None yet

1 participant