* fix: fetch csrf cookie and set headers lazily
* fix: check cookie each call to keep it up to date
Previously the cookie was checked once and never updated until the
client was reloaded. Stale or absent cookies would generate incorrect
tokens or no tokens, respectively, causing CSRF errors.
* Added displayUsername and username update functionality
* fix: move username assignment to safe place
moved the username assignment down a statement so that it doesn't cause exception
* fix: handle missing username or displayUsername
* refactor: remove redundant code
The Privacy component has been simplified and made to rely on the user
prop rather than its own state. The submitProfileUIComplete reducer was
missing so has been added.
* fix: add report user button back to profile pages
* fix: make local redirect to signin work
* fix: redirect to learn instead of homepage
* fix: change from gatsby Link to the helper component Link
* feat: add tests for profile report and settings buttons
* Update client/src/client-only-routes/ShowUser.js
Co-Authored-By: Oliver Eyton-Williams <ojeytonwilliams@gmail.com>
* Update client/src/client-only-routes/ShowUser.js
Co-Authored-By: Oliver Eyton-Williams <ojeytonwilliams@gmail.com>
* Update client/src/client-only-routes/ShowUser.js
Co-Authored-By: Oliver Eyton-Williams <ojeytonwilliams@gmail.com>
* Update client/src/client-only-routes/ShowUser.js
Co-Authored-By: Oliver Eyton-Williams <ojeytonwilliams@gmail.com>
* Update client/src/client-only-routes/ShowUser.js
Co-Authored-By: Oliver Eyton-Williams <ojeytonwilliams@gmail.com>
* feat: Curriculum page loads with current challenge block open
* feat: Curriculum page expansion changes from review
* feat: Curriculum page expansion changes from second review
* fix: use a cookie to track current challenge
* fix: remove redundant server changes
* fix: add PropTypes to fix lint error
* fix: change cookies to store and add tests
* fix: use currentChallengeId
* fix: update tests
I couldn't figure out how to test the challenge saga, so that's gone for
now. The Map tests have been updated to use currentChallengeId
* fix: remove unused PropTypes
* fix: separate currentChallengeId from user
* fix: update currentChallengeId directly on mount
* feat: reset map on every visit
* fix(client): add warning on exceeding forum post length limit
Co-authored-by: Mrugesh Mohapatra <1884376+raisedadead@users.noreply.github.com>
* fix: corrected guide url for backend challenges and projects
* fix: moved getGuideUrl to utils
* fix: added forumTopicId to ChallengeNode PropTypes
* fix: conolidated helpers and add base url to env.json
* fix: made use template literals
* tests: created unit tests for getGuideUrl
* fix: add characters which will be encoded
Co-Authored-By: Oliver Eyton-Williams <ojeytonwilliams@gmail.com>
* fix: use encoded version of title
Co-Authored-By: Oliver Eyton-Williams <ojeytonwilliams@gmail.com>
* fix: encode title
Co-Authored-By: Oliver Eyton-Williams <ojeytonwilliams@gmail.com>