Local Passwords validation

This commit is contained in:
Paul Schneider 2024-11-06 13:00:34 +00:00
commit 8132db37d0
163 changed files with 1812 additions and 4772 deletions

View file

@ -23,12 +23,13 @@ namespace Yavsc.ViewModels.UserFiles
{
}
public UserDirectoryInfo(string userReposPath, string username, string path)
public UserDirectoryInfo(string userReposPath, string userId, string path)
{
if (string.IsNullOrWhiteSpace(username))
if (string.IsNullOrWhiteSpace(userId))
throw new NotSupportedException("No user name, no user dir.");
UserName = username;
var finalPath = path == null ? username : Path.Combine(username, path);
UserName = userId;
var finalPath = path == null ? userId : Path.Combine(userId, path);
if (!finalPath.IsValidYavscPath())
throw new InvalidOperationException(
$"File name contains invalid chars ({finalPath})");