mirror of
https://github.com/Termix-SSH/Termix.git
synced 2026-10-28 14:15:24 +00:00
fix(auth): allow retrying unavailable second-factor interfaces (#1549)
This commit is contained in:
1 parent
c66702deb1
commit
c9a1348836
6 files changed
+79
-7
No files matched your search
@@ -232,6 +232,20 @@ describe("plugin loader", () => {
|
||||
expect(isPluginFrontendActive("alpha")).toBe(true);
|
||||
});
|
||||
|
||||
it("retries failed login bundles only when explicitly requested", async () => {
|
||||
vi.spyOn(console, "error").mockImplementation(() => {});
|
||||
vi.spyOn(globalThis, "fetch").mockImplementation(
|
||||
async () => new Response(JSON.stringify([summary("login")])),
|
||||
);
|
||||
await startPreLoginPlugins();
|
||||
expect(isPluginFrontendActive("login")).toBe(false);
|
||||
modules.login = railPlugin("login");
|
||||
await startPreLoginPlugins();
|
||||
expect(isPluginFrontendActive("login")).toBe(false);
|
||||
await startPreLoginPlugins({ retryFailed: true });
|
||||
expect(isPluginFrontendActive("login")).toBe(true);
|
||||
});
|
||||
|
||||
it("ignores a pre-login load started after sign-in", async () => {
|
||||
modules.login = railPlugin("login");
|
||||
modules.alpha = railPlugin("alpha");
|
||||
|
||||
Reference in new issue
Block a user