twenty/packages/twenty-front
Charles Bochet c69d665114
Fix reset PasswordToken (#6366)
## Bug Description

We are facing a bug in case recaptcha is enabled.
To reproduce:
- Create your recaptcha: https://www.google.com/recaptcha/about/
- update your server .env with the following variables:

```
CAPTCHA_SECRET_KEY=REPLACE_ME
CAPTCHA_SITE_KEY=REPLACE_ME
CAPTCHA_DRIVER=google-recaptcha
```

- Go to the login page, enter an existing user email and hit 'Reset your
password'.

- Add a console.log in emailPasswordResetLink in auth.resolver.ts to get
the token that would be sent by email if you don't have the mailer setup

- Browse: /reset-password/{passwordToken}

- Update the password:
<img width="1446" alt="image"
src="https://github.com/user-attachments/assets/dd5b077f-293e-451a-8630-22d24ac66c42">

- See that the token is invalid

You should see two calls in your developer network tab. A successful one
to update the password and another to log you in. This 2nd call
(Challenge) does not have the captcha token provided. It should be

## Fix

- Refreshing the token on page load
- providing it to the Challenge graphql call
2024-07-22 17:36:31 +02:00
..
__mocks__ Fix overlay scroll gaps (#4512) 2024-03-31 10:53:37 +02:00
.storybook Clarify storybook tests (#6073) 2024-06-30 20:02:13 +02:00
public Change email tab placeholder illustration (#5550) 2024-05-23 18:26:08 +02:00
scripts feat: add SENTRY_RELEASE env (#4912) 2024-04-11 16:53:15 +02:00
src Fix reset PasswordToken (#6366) 2024-07-22 17:36:31 +02:00
.env.example Delete auth/file front variables (#4455) 2024-03-19 22:19:40 +01:00
.eslintrc-ci.cjs chore: enable no-console eslint rule for tests and stories (#4816) 2024-04-04 18:36:39 +02:00
.eslintrc.cjs Increase storybook pages coverage (#4885) 2024-04-17 16:24:04 +02:00
.gitignore Feat/put target object identifier on use activities (#4682) 2024-04-01 13:12:37 +02:00
.prettierignore Update twenty-front commands (#4667) 2024-04-17 18:06:02 +02:00
.swcrc Migrate to a monorepo structure (#2909) 2023-12-10 18:10:54 +01:00
codegen-metadata.cjs Upsert endpoint and CSV import upsert (#5970) 2024-06-26 11:39:16 +02:00
codegen.cjs Upsert endpoint and CSV import upsert (#5970) 2024-06-26 11:39:16 +02:00
index.html Migrate to a monorepo structure (#2909) 2023-12-10 18:10:54 +01:00
jest.config.ts Fix tests and lint (#6303) 2024-07-17 14:52:17 +02:00
nyc.config.cjs Added Linaria for performance optimization (#5693) 2024-06-12 16:31:07 +02:00
package.json Bump version to v0.22.0 (#6292) 2024-07-16 17:14:35 +02:00
project.json Fix reset PasswordToken (#6366) 2024-07-22 17:36:31 +02:00
README.md Migrate to a monorepo structure (#2909) 2023-12-10 18:10:54 +01:00
setupTests.ts chore: setup twenty-ui absolute path alias (#4732) 2024-04-04 15:38:01 +02:00
tsconfig.app.json fix: fix root start script (#5032) 2024-04-19 18:28:02 +02:00
tsconfig.json 4900 multi select field front implement expanded cells (#5151) 2024-05-03 15:03:06 +02:00
tsconfig.spec.json fix: fix root start script (#5032) 2024-04-19 18:28:02 +02:00
tsconfig.storybook.json fix: fix root start script (#5032) 2024-04-19 18:28:02 +02:00
tsup.config.ts Update twenty-front commands (#4667) 2024-04-17 18:06:02 +02:00
tsup.ui.index.tsx feat: implement new SnackBar design (#5515) 2024-05-23 12:19:50 +02:00
vite.config.ts 5421 box shadow on frozen header and first column (#6130) 2024-07-05 18:30:59 +02:00

Run yarn dev while server running on port 3000