Skip to content

Commit

Permalink
chore: use the same form creation for all the common ones
Browse files Browse the repository at this point in the history
  • Loading branch information
meysam81 committed May 19, 2024
1 parent fcd8666 commit 63b3daa
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 173 deletions.
34 changes: 0 additions & 34 deletions frontend/src/login.js

This file was deleted.

2 changes: 1 addition & 1 deletion frontend/src/logout.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { createFlowForm, getFlowInfo, initFlow, whoami } from "./utils.js";
import { initFlow } from "./utils.js";

async function createForm() {
var flowInfo;
Expand Down
32 changes: 0 additions & 32 deletions frontend/src/recovery.js

This file was deleted.

32 changes: 0 additions & 32 deletions frontend/src/register.js

This file was deleted.

16 changes: 6 additions & 10 deletions frontend/src/router.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
import IndexForm from "./index.js";
import LoginForm from "./login.js";
import RegisterForm from "./register.js";
import VerifyForm from "./verify.js";
import RecoveryForm from "./recovery.js";
import SettingsForm from "./settings.js";
import LogOutForm from "./logout.js";
import CreateForm from "./flow.js";

const Router = {
init: async function init_() {
Expand Down Expand Up @@ -40,23 +36,23 @@ const Router = {
break;
case route.startsWith("/login"):
document.title = "Login - Developer Friendly";
pageElement = await LoginForm(flowId);
pageElement = await CreateForm(flowId, "login");
break;
case route.startsWith("/register"):
document.title = "Register - Developer Friendly";
pageElement = await RegisterForm(flowId);
pageElement = await CreateForm(flowId, "registration");
break;
case route.startsWith("/verify"):
document.title = "Verify - Developer Friendly";
pageElement = await VerifyForm(flowId);
pageElement = await CreateForm(flowId, "verification");
break;
case route.startsWith("/recovery"):
document.title = "Recovery - Developer Friendly";
pageElement = await RecoveryForm(flowId);
pageElement = await CreateForm(flowId, "recovery");
break;
case route.startsWith("/settings"):
document.title = "Settings - Developer Friendly";
pageElement = await SettingsForm(flowId);
pageElement = await CreateForm(flowId, "settings");
break;
case route.startsWith("/logout"):
document.title = "Log Out - Developer Friendly";
Expand Down
32 changes: 0 additions & 32 deletions frontend/src/settings.js

This file was deleted.

32 changes: 0 additions & 32 deletions frontend/src/verify.js

This file was deleted.

0 comments on commit 63b3daa

Please sign in to comment.