1
0
mirror of https://github.com/bitwarden/server.git synced 2025-06-30 07:36:14 -05:00

Turn on file scoped namespaces (#2225)

This commit is contained in:
Justin Baur
2022-08-29 14:53:16 -04:00
committed by GitHub
parent 7c4521e0b4
commit 34fb4cca2a
1206 changed files with 73816 additions and 75022 deletions

View File

@ -1,34 +1,33 @@
namespace Bit.Setup
namespace Bit.Setup;
public class AppIdBuilder
{
public class AppIdBuilder
private readonly Context _context;
public AppIdBuilder(Context context)
{
private readonly Context _context;
_context = context;
}
public AppIdBuilder(Context context)
public void Build()
{
var model = new TemplateModel
{
_context = context;
}
Url = _context.Config.Url
};
public void Build()
// Needed for backwards compatability with migrated U2F tokens.
Helpers.WriteLine(_context, "Building FIDO U2F app id.");
Directory.CreateDirectory("/bitwarden/web/");
var template = Helpers.ReadTemplate("AppId");
using (var sw = File.CreateText("/bitwarden/web/app-id.json"))
{
var model = new TemplateModel
{
Url = _context.Config.Url
};
// Needed for backwards compatability with migrated U2F tokens.
Helpers.WriteLine(_context, "Building FIDO U2F app id.");
Directory.CreateDirectory("/bitwarden/web/");
var template = Helpers.ReadTemplate("AppId");
using (var sw = File.CreateText("/bitwarden/web/app-id.json"))
{
sw.Write(template(model));
}
}
public class TemplateModel
{
public string Url { get; set; }
sw.Write(template(model));
}
}
public class TemplateModel
{
public string Url { get; set; }
}
}