also looking at this
fix(auth): send people to their reports, and make a dead redirect fail the build
#34
5 files
+59
-16
| @@ -3,7 +3,7 @@ | ||
| 3 | 3 | // |
| 4 | 4 | // The one page in the app that must render for a stranger, so it carries no |
| 5 | 5 | // AuthGuard and no app chrome. It does the opposite check instead: somebody who |
| 6 | // already has a session is sent to their projects rather than shown a form | |
| 6 | // already has a session is sent to their reports rather than shown a form | |
| 7 | 7 | // asking them to do something they have already done. |
| 8 | 8 | import { sessionCookieName, sessionFrom } from '../../app/Support/session' |
| 9 | 9 | |
| @@ -17,7 +17,7 @@ const signedIn = session.user !== null | ||
| 17 | 17 | {{-- Already signed in: bounce before anything paints, the same way the |
| 18 | 18 | guard does in the other direction. --}} |
| 19 | 19 | @if (signedIn) |
| 20 | <script>window.location.replace('/projects')</script> | |
| 20 | <script>window.location.replace('/reports')</script> | |
| 21 | 21 | @endif |
| 22 | 22 | |
| 23 | 23 | <script>document.documentElement.setAttribute('data-session-cookie', {{ cookieName }})</script> |
| @@ -121,7 +121,7 @@ const signedIn = session.user !== null | ||
| 121 | 121 | if (res.ok) { |
| 122 | 122 | // replace, not assign: the back button should not return to a sign-in |
| 123 | 123 | // form the person has already used. |
| 124 | window.location.replace('/projects') | |
| 124 | window.location.replace('/reports') | |
| 125 | 125 | return |
| 126 | 126 | } |
| 127 | 127 | |