diff --git a/apps/api/src/app/controllers/user.controller.ts b/apps/api/src/app/controllers/user.controller.ts index 4590c792..3f97db72 100644 --- a/apps/api/src/app/controllers/user.controller.ts +++ b/apps/api/src/app/controllers/user.controller.ts @@ -183,7 +183,10 @@ const getFullUserProfile = createRoute(routeDefinition.getFullUserProfile.valida const initPassword = createRoute(routeDefinition.initPassword.validators, async ({ body, user }, req, res) => { const { password } = body; - await setPasswordForUser(user.id, password); + const results = await setPasswordForUser(user.id, password); + if ('error' in results) { + throw new UserFacingError(results.error); + } sendJson(res, await userDbService.findUserWithIdentitiesById(user.id)); createUserActivityFromReq(req, res, { diff --git a/apps/api/src/app/routes/auth.routes.ts b/apps/api/src/app/routes/auth.routes.ts index a1eb351f..8f663d1b 100644 --- a/apps/api/src/app/routes/auth.routes.ts +++ b/apps/api/src/app/routes/auth.routes.ts @@ -38,7 +38,7 @@ routes.get('/csrf', LAX_AuthRateLimit, authController.routeDefinition.getCsrfTok routes.get('/session', LAX_AuthRateLimit, authController.routeDefinition.getSession.controllerFn()); // Init OAuth flow -routes.post('/signin/:provider', STRICT_AuthRateLimit, verifyCaptcha, authController.routeDefinition.signin.controllerFn()); +routes.post('/signin/:provider', STRICT_AuthRateLimit, authController.routeDefinition.signin.controllerFn()); // Login via OAuth or credentials routes.get('/callback/:provider', STRICT_AuthRateLimit, authController.routeDefinition.callback.controllerFn()); routes.post('/callback/:provider', STRICT_AuthRateLimit, verifyCaptcha, authController.routeDefinition.callback.controllerFn()); diff --git a/apps/jetstream-e2e/src/pageObjectModels/AuthenticationPage.model.ts b/apps/jetstream-e2e/src/pageObjectModels/AuthenticationPage.model.ts index eeb2ab6b..64193f48 100644 --- a/apps/jetstream-e2e/src/pageObjectModels/AuthenticationPage.model.ts +++ b/apps/jetstream-e2e/src/pageObjectModels/AuthenticationPage.model.ts @@ -228,7 +228,9 @@ export class AuthenticationPage { await this.goToPasswordReset(); await this.fillOutResetPasswordForm(email); - await expect(this.page.getByText('Check your email to continue the reset process.')).toBeVisible(); + await expect( + this.page.getByText('You will receive an email with instructions if an account exists and is eligible for password reset.') + ).toBeVisible(); // ensure email verification was sent await prisma.emailActivity.findFirstOrThrow({ where: { email, subject: { contains: 'Reset your password' } } }); diff --git a/apps/jetstream-e2e/src/tests/authentication/login2.spec.ts b/apps/jetstream-e2e/src/tests/authentication/login2.spec.ts index 2ee6ba0a..087c38ee 100644 --- a/apps/jetstream-e2e/src/tests/authentication/login2.spec.ts +++ b/apps/jetstream-e2e/src/tests/authentication/login2.spec.ts @@ -22,7 +22,9 @@ test.describe('Login 2', () => { await authenticationPage.goToPasswordReset(); await authenticationPage.fillOutResetPasswordForm(email); - await expect(page.getByText('Check your email to continue the reset process.')).toBeVisible(); + await expect( + page.getByText('You will receive an email with instructions if an account exists and is eligible for password reset.') + ).toBeVisible(); // ensure email verification was sent await prisma.emailActivity.findFirstOrThrow({ where: { email, subject: { contains: 'Reset your password' } } }); diff --git a/apps/jetstream/src/app/components/profile/Profile.tsx b/apps/jetstream/src/app/components/profile/Profile.tsx index 1f45cc5c..395d6532 100644 --- a/apps/jetstream/src/app/components/profile/Profile.tsx +++ b/apps/jetstream/src/app/components/profile/Profile.tsx @@ -121,7 +121,7 @@ export const Profile = () => { trackEvent(ANALYTICS_KEYS.settings_password_action, { action: 'set-password' }); } catch (ex) { fireToast({ - message: 'There was a problem setting your password. Try again or file a support ticket for assistance.', + message: ex.message || 'There was a problem resetting your password. Try again or file a support ticket for assistance.', type: 'error', }); rollbar.error('Settings: Error setting password', { stack: ex.stack, message: ex.message }); @@ -138,7 +138,7 @@ export const Profile = () => { }); } catch (ex) { fireToast({ - message: 'There was a problem resetting your password. Try again or file a support ticket for assistance.', + message: ex.message || 'There was a problem resetting your password. Try again or file a support ticket for assistance.', type: 'error', }); rollbar.error('Settings: Error resetting password', { stack: ex.stack, message: ex.message }); diff --git a/apps/landing/components/auth/LoginOrSignUp.tsx b/apps/landing/components/auth/LoginOrSignUp.tsx index 703f1528..6e9a9513 100644 --- a/apps/landing/components/auth/LoginOrSignUp.tsx +++ b/apps/landing/components/auth/LoginOrSignUp.tsx @@ -129,7 +129,54 @@ export function LoginOrSignUp({ action, providers, csrfToken }: LoginOrSignUpPro {action === 'login' ? 'Sign in' : 'Sign up'} +