mirror of
				https://github.com/zoriya/Kyoo.git
				synced 2025-11-03 19:17:16 -05:00 
			
		
		
		
	Format code
This commit is contained in:
		
							parent
							
								
									c3dae2c704
								
							
						
					
					
						commit
						ca35611925
					
				@ -203,11 +203,14 @@ namespace Kyoo.Authentication.Views
 | 
				
			|||||||
			User user = await _users.Get(User.GetIdOrThrow());
 | 
								User user = await _users.Get(User.GetIdOrThrow());
 | 
				
			||||||
			if (!BCryptNet.Verify(request.OldPassword, user.Password))
 | 
								if (!BCryptNet.Verify(request.OldPassword, user.Password))
 | 
				
			||||||
				return Forbid(new RequestError("The old password is invalid."));
 | 
									return Forbid(new RequestError("The old password is invalid."));
 | 
				
			||||||
			return await _users.Patch(user.Id, (user) =>
 | 
								return await _users.Patch(
 | 
				
			||||||
			{
 | 
									user.Id,
 | 
				
			||||||
				user.Password = BCryptNet.HashPassword(request.NewPassword);
 | 
									(user) =>
 | 
				
			||||||
				return user;
 | 
									{
 | 
				
			||||||
			});
 | 
										user.Password = BCryptNet.HashPassword(request.NewPassword);
 | 
				
			||||||
 | 
										return user;
 | 
				
			||||||
 | 
									}
 | 
				
			||||||
 | 
								);
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		/// <summary>
 | 
							/// <summary>
 | 
				
			||||||
@ -288,7 +291,9 @@ namespace Kyoo.Authentication.Views
 | 
				
			|||||||
				if (patch.Id.HasValue && patch.Id != userId)
 | 
									if (patch.Id.HasValue && patch.Id != userId)
 | 
				
			||||||
					throw new ArgumentException("Can't edit your user id.");
 | 
										throw new ArgumentException("Can't edit your user id.");
 | 
				
			||||||
				if (patch.ContainsKey(nameof(Abstractions.Models.User.Password)))
 | 
									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);
 | 
									return await _users.Patch(userId, patch.Apply);
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
			catch (ItemNotFoundException)
 | 
								catch (ItemNotFoundException)
 | 
				
			||||||
 | 
				
			|||||||
@ -33,7 +33,7 @@ declare module "react" {
 | 
				
			|||||||
	): (props: P & React.RefAttributes<T>) => React.ReactElement | null;
 | 
						): (props: P & React.RefAttributes<T>) => React.ReactElement | null;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
export type Icon =ComponentType<SvgProps>;
 | 
					export type Icon = ComponentType<SvgProps>;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
type IconProps = {
 | 
					type IconProps = {
 | 
				
			||||||
	icon: Icon;
 | 
						icon: Icon;
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user