[x] If the API response contains errors, the user should be shown a modal with the reason
[x] If the API response is successful, redirect the user to the homepage with a success modal and logout the current user (if any are logged in)
What might break?
Routing? In order to validate the reset code during navigation, this would seemingly be best to be done in a custom middleware. This bit is new to me, so I would highly recommend reading the docs on how this should be setup: https://nuxt.com/docs/guide/directory-structure/middleware
What are you wanting to be added?
Goal: Password recovery
It's inevitable. No matter what happens someone will forget their password, and we need to be able to support them setting a new one.
Objectives:
[x] Modify the current login modal, to add a![image](https://github.com/leaderboardsgg/leaderboard-site/assets/17736056/0271e54f-bf47-4880-ae0c-8774944388e9)
Forgot my password
option[x] Clicking this new option should open a new modal of a similar design, with an email field, a username field, and a submit button
[x] The button should only be active when there is a valid email and a username in the inputs
[x] Clicking the button should hit the appropriate backend API to trigger sending a recovery email, with the use of a new composable (see the current API composable's for reference)
After receiving an email, with a link to
/reset-password?code={code}
./reset-password
pagecode
param present in the request, abort the navigation altogetherDuring navigation:
code
code
is not valid, redirect the user to the homepage with a modal showing the reason whycode
is valid, finish the navigation to the pageAfter navigation:
password
andpasswordConfirmation
(similar to the sign up modal), and a button with the textChange password
What might break?
Routing? In order to validate the reset code during navigation, this would seemingly be best to be done in a custom middleware. This bit is new to me, so I would highly recommend reading the docs on how this should be setup: https://nuxt.com/docs/guide/directory-structure/middleware
Relevant Issues
Parent Issue: https://github.com/leaderboardsgg/leaderboard-site/issues/556 Backend Issue: https://github.com/leaderboardsgg/leaderboard-backend/issues/144