Skip to content

Commit

Permalink
Format code
Browse files Browse the repository at this point in the history
  • Loading branch information
zoriya committed Jan 10, 2024
1 parent c3dae2c commit ca35611
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
17 changes: 11 additions & 6 deletions back/src/Kyoo.Authentication/Views/AuthApi.cs
Original file line number Diff line number Diff line change
Expand Up @@ -203,11 +203,14 @@ public async Task<ActionResult<User>> ResetPassword([FromBody] PasswordResetRequ
User user = await _users.Get(User.GetIdOrThrow());
if (!BCryptNet.Verify(request.OldPassword, user.Password))
return Forbid(new RequestError("The old password is invalid."));
return await _users.Patch(user.Id, (user) =>
{
user.Password = BCryptNet.HashPassword(request.NewPassword);
return user;
});
return await _users.Patch(
user.Id,
(user) =>
{
user.Password = BCryptNet.HashPassword(request.NewPassword);
return user;
}
);
}

/// <summary>
Expand Down Expand Up @@ -288,7 +291,9 @@ public async Task<ActionResult<User>> PatchMe([FromBody] Patch<User> patch)
if (patch.Id.HasValue && patch.Id != userId)
throw new ArgumentException("Can't edit your user id.");
if (patch.ContainsKey(nameof(Abstractions.Models.User.Password)))
throw new ArgumentException("Can't edit your password via a PATCH. Use /auth/password-reset");
throw new ArgumentException(
"Can't edit your password via a PATCH. Use /auth/password-reset"
);
return await _users.Patch(userId, patch.Apply);
}
catch (ItemNotFoundException)
Expand Down
2 changes: 1 addition & 1 deletion front/packages/primitives/src/icons.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ declare module "react" {
): (props: P & React.RefAttributes<T>) => React.ReactElement | null;
}

export type Icon =ComponentType<SvgProps>;
export type Icon = ComponentType<SvgProps>;

type IconProps = {
icon: Icon;
Expand Down

0 comments on commit ca35611

Please sign in to comment.