Hide signup/signin pages from authenticated user, redirect to / if accessed
I didn't use useEffect() here since I didn't find a need to render the sign-in/sign-up page before the check. Returning null will not render anything.
We could consider redirecting to /projects if an authorized user accesses /
Codecov Report
Merging #343 (845c9f5) into master (2cac0fd) will increase coverage by
0.33%. The diff coverage is20.00%.
:exclamation: Current head 845c9f5 differs from pull request most recent head fe24578. Consider uploading reports for the commit fe24578 to get more accurate results
@@ Coverage Diff @@
## master #343 +/- ##
==========================================
+ Coverage 60.87% 61.21% +0.33%
==========================================
Files 126 126
Lines 1958 2202 +244
Branches 380 534 +154
==========================================
+ Hits 1192 1348 +156
- Misses 731 848 +117
+ Partials 35 6 -29
| Impacted Files | Coverage Δ | |
|---|---|---|
| src/helpers/user-auth-helper.ts | 56.25% <0.00%> (-29.47%) |
:arrow_down: |
| src/pages/signin.tsx | 0.00% <0.00%> (ø) |
|
| src/pages/signup.tsx | 0.00% <0.00%> (ø) |
|
| src/components/index-page/hero.tsx | 95.23% <75.00%> (-4.77%) |
:arrow_down: |
| src/components/shared/buttons/project-button.tsx | 20.00% <0.00%> (-13.34%) |
:arrow_down: |
| src/components/shared/page/page-body.tsx | 87.50% <0.00%> (-12.50%) |
:arrow_down: |
| src/components/account/account-settings.tsx | 78.94% <0.00%> (-7.72%) |
:arrow_down: |
| src/components/shared/form/controls2.tsx | 36.84% <0.00%> (-6.91%) |
:arrow_down: |
| src/components/shared/social-icon.tsx | 26.66% <0.00%> (-6.67%) |
:arrow_down: |
| src/components/shared/seo.tsx | 89.47% <0.00%> (-4.28%) |
:arrow_down: |
| ... and 55 more |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact),ø = not affected,? = missing dataPowered by Codecov. Last update 2cac0fd...fe24578. Read the comment docs.