Skip to content

Commit

Permalink
More fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
FelixMalfait committed Feb 2, 2025
1 parent afc284c commit 36a94f1
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 23 deletions.
4 changes: 0 additions & 4 deletions packages/twenty-front/src/generated/graphql.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -958,7 +958,6 @@ export type MutationUpdateOneServerlessFunctionArgs = {


export type MutationUpdatePasswordViaResetTokenArgs = {
locale: Scalars['String'];
newPassword: Scalars['String'];
passwordResetToken: Scalars['String'];
};
Expand Down Expand Up @@ -2059,7 +2058,6 @@ export type SignUpMutation = { __typename?: 'Mutation', signUp: { __typename?: '
export type UpdatePasswordViaResetTokenMutationVariables = Exact<{
token: Scalars['String'];
newPassword: Scalars['String'];
locale: Scalars['String'];
}>;


Expand Down Expand Up @@ -3217,7 +3215,6 @@ export const UpdatePasswordViaResetTokenDocument = gql`
updatePasswordViaResetToken(
passwordResetToken: $token
newPassword: $newPassword
locale: $locale
) {
success
}
Expand All @@ -3240,7 +3237,6 @@ export type UpdatePasswordViaResetTokenMutationFn = Apollo.MutationFunction<Upda
* variables: {
* token: // value for 'token'
* newPassword: // value for 'newPassword'
* locale: // value for 'locale'
* },
* });
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,10 @@
import { gql } from '@apollo/client';

export const UPDATE_PASSWORD_VIA_RESET_TOKEN = gql`
mutation UpdatePasswordViaResetToken(
$token: String!
$newPassword: String!
$locale: String!
) {
mutation UpdatePasswordViaResetToken($token: String!, $newPassword: String!) {
updatePasswordViaResetToken(
passwordResetToken: $token
newPassword: $newPassword
locale: $locale
) {
success
}
Expand Down
3 changes: 1 addition & 2 deletions packages/twenty-front/src/pages/auth/PasswordReset.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ const StyledInputContainer = styled.div`
`;

export const PasswordReset = () => {
const { t, i18n } = useLingui();
const { t } = useLingui();
const { enqueueSnackBar } = useSnackBar();

const workspacePublicData = useRecoilValue(workspacePublicDataState);
Expand Down Expand Up @@ -132,7 +132,6 @@ export const PasswordReset = () => {
variables: {
token: formData.passwordResetToken,
newPassword: formData.newPassword,
locale: i18n.locale,
},
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -354,18 +354,19 @@ export class AuthResolver {
@Mutation(() => InvalidatePassword)
async updatePasswordViaResetToken(
@Args()
{
passwordResetToken,
newPassword,
locale,
}: UpdatePasswordViaResetTokenInput,
{ passwordResetToken, newPassword }: UpdatePasswordViaResetTokenInput,
@Context() context: I18nContext,
): Promise<InvalidatePassword> {
const { id } =
await this.resetPasswordService.validatePasswordResetToken(
passwordResetToken,
);

await this.authService.updatePassword(id, newPassword, locale);
await this.authService.updatePassword(
id,
newPassword,
context.req.headers['x-locale'] || 'en',
);

return await this.resetPasswordService.invalidatePasswordResetToken(id);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,4 @@ export class UpdatePasswordViaResetTokenInput {
@IsNotEmpty()
@IsString()
newPassword: string;

@Field(() => String)
@IsNotEmpty()
@IsString()
locale: string;
}

0 comments on commit 36a94f1

Please sign in to comment.