Skip to content

Commit 09ae216

Browse files
committed
Remove scope creep/reduce diff size
1 parent 63a3790 commit 09ae216

1 file changed

Lines changed: 0 additions & 31 deletions

File tree

backend/FwLite/FwLiteWeb/FwLiteWebServer.cs

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -43,37 +43,6 @@ public static WebApplication SetupAppServer(WebApplicationOptions options, Actio
4343
..config.LexboxServers,
4444
new(new("https://lexbox.org"), "Lexbox")
4545
]);
46-
var configuredCacheFile = builder.Configuration["Auth:CacheFileName"];
47-
builder.Services.PostConfigure<AuthConfig>(config =>
48-
{
49-
//honour an explicitly configured cache path; only supply our default location otherwise.
50-
if (!string.IsNullOrEmpty(configuredCacheFile)) return;
51-
52-
//stable per-user cache location. A binary-relative path is orphaned under Platform.Bible, which
53-
//extracts each extension version to a versioned cache dir, so every update would log the user out.
54-
var localAppData = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData);
55-
//GetFolderPath can return "" on a headless/container host with no HOME; fall back to the binary
56-
//dir so the path stays fully qualified (BuildCacheProperties rejects relative paths).
57-
var baseDir = string.IsNullOrEmpty(localAppData) ? AppContext.BaseDirectory : localAppData;
58-
var cacheDir = Path.Combine(baseDir, "SIL", "FwLiteWeb");
59-
Directory.CreateDirectory(cacheDir);
60-
var cacheFile = Path.Combine(cacheDir, "msal.json");
61-
62-
var legacyCacheFile = Path.Combine(AppContext.BaseDirectory, "msal.json");
63-
if (!File.Exists(cacheFile) && File.Exists(legacyCacheFile))
64-
{
65-
try
66-
{
67-
File.Copy(legacyCacheFile, cacheFile);
68-
}
69-
catch
70-
{
71-
//a failed migration just means one re-login; never break startup over it.
72-
}
73-
}
74-
75-
config.CacheFileName = cacheFile;
76-
});
7746
builder.Services.Configure<FwLiteConfig>(config =>
7847
{
7948
config.AppVersion = VersionHelper.DisplayVersion(typeof(FwLiteWebServer).Assembly);

0 commit comments

Comments
 (0)